Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the user to supply root cert store #2446

Open
stevefan1999-personal opened this issue Oct 15, 2024 · 1 comment
Open

Allow the user to supply root cert store #2446

stevefan1999-personal opened this issue Oct 15, 2024 · 1 comment

Comments

@stevefan1999-personal
Copy link
Contributor

I happen to stumble upon here:

#[cfg(feature = "rustls-tls-webpki-roots")]
if config.tls_built_in_certs_webpki {
root_cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
}

I'm using a custom Rustls provider with RustCrypto which is in pure Rust, and I'm not using ring and do not want ring in the dependency chain.

However, I cannot control this at the moment, so I have to improvise like this:

pub fn make_client() -> Result<Client, Error> {
    let mut builder = Client::builder();
    for cert in webpki_root_certs::TLS_SERVER_ROOT_CERTS {
        builder = builder.add_root_certificate(Certificate::from_der(cert).unwrap())
    }
    builder.build()
}

Which is pretty annoying.

Repository owner deleted a comment Oct 28, 2024
@stevefan1999-personal
Copy link
Contributor Author

Partially solved by #2447 but it is limited to webpki roots. If you want other roots there is no luck atm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant