In the payjoin crate our Cargo.toml states
|
io = ["v2", "reqwest/rustls-tls"] |
|
_manual-tls = ["reqwest/rustls-tls", "rustls"] |
but the only place this is used for is
|
#[cfg(feature = "_manual-tls")] |
|
pub async fn fetch_ohttp_keys_with_cert( |
|
ohttp_relay: impl IntoUrl, |
|
payjoin_directory: impl IntoUrl, |
|
cert_der: &[u8], |
|
) -> Result<OhttpKeys, Error> { |
|
let ohttp_keys_url = payjoin_directory.into_url()?.join("/.well-known/ohttp-gateway")?; |
|
let proxy = Proxy::all(ohttp_relay.into_url()?.as_str())?; |
|
let client = Client::builder() |
|
.use_rustls_tls() |
|
.add_root_certificate(reqwest::tls::Certificate::from_der(cert_der)?) |
|
.proxy(proxy) |
|
.http1_only() |
|
.build()?; |
|
let res = client |
|
.get(ohttp_keys_url) |
|
.timeout(Duration::from_secs(10)) |
|
.header(ACCEPT, "application/ohttp-keys") |
|
.send() |
|
.await?; |
|
parse_ohttp_keys_response(res).await |
|
} |
Should we require this to be gated behind both io and _manual-tls with a
#[cfg(all(feature = "_manual-tls", feature = "io"))]
Or can the reqwest dep just be safely removed already since it is inside of io.rs?
With this change we would be able to completely close #1124 following the merge of #1377
Right now in benalleng:url-rewrite the following command still shows a build dep of url without the io feature (while _manual-tls and _test-utils are dev features they are not explicitly io so I want to make sure that it is foolproof)
cargo tree -p payjoin --no-default-features --features v1,v2,directory,_manual-tls,_test-utils -i url -e no-dev,no-build
In the payjoin crate our Cargo.toml states
rust-payjoin/payjoin/Cargo.toml
Lines 38 to 39 in 332755b
but the only place this is used for is
rust-payjoin/payjoin/src/core/io.rs
Lines 44 to 65 in 332755b
Should we require this to be gated behind both io and _manual-tls with a
Or can the reqwest dep just be safely removed already since it is inside of
io.rs?With this change we would be able to completely close #1124 following the merge of #1377
Right now in benalleng:url-rewrite the following command still shows a build dep of url without the io feature (while
_manual-tlsand_test-utilsare dev features they are not explicitlyioso I want to make sure that it is foolproof)