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

Add webpki roots option for rustls no provider setup #2447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stevefan1999-personal
Copy link

@stevefan1999-personal stevefan1999-personal commented Oct 15, 2024

This PR allows you to use webpki roots without having to enable ring, and allows custom providers to test. It also immediately shaved 90KB off my binary for a personal embedded project I'm working on without resorting to a hack 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()
}


rustls-tls-manual-roots = ["rustls-tls-manual-roots-no-provider", "__rustls-ring"]
rustls-tls-webpki-roots = ["rustls-tls-webpki-roots-no-provider", "__rustls-ring"]
rustls-tls-native-roots = ["rustls-tls-native-roots-no-provider", "__rustls-ring"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 our backward compatibility here is starting to hurt!

Copy link
Author

@stevefan1999-personal stevefan1999-personal Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why you should throw it away if it is starting to hurt. At least that's what I would do to something I control

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

Successfully merging this pull request may close these issues.

2 participants