Skip to content

Pending openssl_probe RUSTSEC advisory #315

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

Closed
mmastrac opened this issue Jan 24, 2025 · 2 comments · Fixed by #316
Closed

Pending openssl_probe RUSTSEC advisory #315

mmastrac opened this issue Jan 24, 2025 · 2 comments · Fixed by #316

Comments

@mmastrac
Copy link

As a heads up, there's an advisory in progress for openssl_probe (rustsec/advisory-db#2209). As native-tls is one of the largest consumers, it will likely be necessary to switch to an alternate way of specifying the OpenSSL trust roots to the SSL contexts.

I believe that this can be done using X509_LOOKUP_ctrl which is not currently exposed in the openssl crate, but forms the basis of how the root store can be configured to read from various directories.

https://docs.rs/openssl-sys/latest/openssl_sys/fn.X509_LOOKUP_ctrl.html

http://man.openbsd.org/X509_LOOKUP_new.3#X509_LOOKUP_add_dir

I believe this crate would first need to call the probe methods (which don't change the environment), and then configure each new connector using the https://docs.rs/openssl/latest/openssl/ssl/struct.SslContextBuilder.html#method.cert_store_mut method.

https://github.com/sfackler/rust-native-tls/blob/master/src/imp/openssl.rs#L277

This might be worth punting to https://github.com/sfackler/rust-openssl for some initial work to add the necessary safe APIs, though I don't think it would be required immediately.

@sfackler
Copy link
Owner

We should just need to expose a variant of https://docs.rs/openssl/latest/openssl/ssl/struct.SslConnectorBuilder.html#method.set_ca_file that also takes the ca dir and feed the discovered locations into that.

@mmastrac
Copy link
Author

Thanks for the quick response, @sfackler 🚀

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 a pull request may close this issue.

2 participants