-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Only use webpki certs despite enabled rustls-tls-native-roots feature #1843
Copy link
Copy link
Closed
Description
I would like to have more fine-grained control over the root certificates added regardless of enabled crate features. ClientBuilder::tls_built_in_root_certs() (added in #1150) only allows to disable/enable all of them.
One solution would be to disable all of them and add any desired ones yourself. This didn't turn out to be ideal because webpki offers already parsed certificates, but ClientBuilder::add_root_certificate() takes a Certificate, which only takes DER or PEM encoded certificates.
Suggested Solutions
- Add a new method,
Certificate::from_rustls(), toCertificate, which takes aOwnedTrustAnchor. This would make it easy to add arbitrary root certificates torustlswithout having to serialize them to DER first, only to have them deserialized byrustlsright after. - Add new methods to
ClientBuilderallowing for more fine-grained control over which built-in certificates are added. E.g.ClientBuilder::tls_webpki_root_certs()andClientBuilder::tls_native_root_certs(). Potentially removingClientBuilder::tls_built_in_root_certs()completely in the next version.
I actually find both solutions could work quite well simultaneously.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels