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

Convert from SslConnector to TlsConnector #196

Closed
massand opened this issue Jan 23, 2021 · 3 comments
Closed

Convert from SslConnector to TlsConnector #196

massand opened this issue Jan 23, 2021 · 3 comments

Comments

@massand
Copy link

massand commented Jan 23, 2021

It would be useful to add the ability to construct a native_tls::TlsConnector from openssl:ssl::SslConnector using:

From<openssl::ssl::SslConnector> for native_tls::TlsConnector

Here is an example scenario - hyper-proxy provides the ability to set the tunneling native_tls::TlsConnector. However, when employing custom OpenSSL engines to offload crypto operations during TLS, the openssl crate is the only convenient path to achieve such an implementation.

It would be cleaner to add support for the openssl::ssl::SslConnector -> native_tls::TlsConnector conversion, which would allow hyper-proxy to continue using native_tls::TlsConnector (and tokio-native-tls stream) for TLS handshake, instead of adding a new hyper-proxy feature for openssl::ssl::SslConnector (and tokio_openssl::SslStream) support.

@sfackler
Copy link
Owner

This crate does not publicly expose the backend libraries so that they can be upgraded without a breaking change. This crate is specifically designed to be a "least common denominator", not an general interface on top of the backend libraries.

@ryankurte
Copy link

Would you be open to adding this behind a feature guard? I understand the intent is to isolate underlying TLS library but, native-tls appears used super commonly as a transitive dependency often exposed in the API of other crates. Because of the least common denominator approach if you need any additional configuration you cannot use -any- of them (at least, without refactoring them to not use native-tls).

@sfackler
Copy link
Owner

sfackler commented Feb 2, 2021

Adding a Cargo feature does not change the fact that exposing the underlying libraries would make it a breaking change to upgrade them. This crate is not intended to be the single canonical TLS library that everything uses.

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

3 participants