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

Use a single TLS implementation #308

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

khanage
Copy link

@khanage khanage commented Aug 31, 2023

Currently native-tls is set as a default feature, but selecting a different tls implementation requires default-features = false in your Cargo.toml.

This PR will select one of the alternatives in alphabetical order, so that if you ask for features = ["vendored-openssl", "rustls", "native-tls"] you will get the implementation for rustls.

This solves a similar issue to #237, but uses cfg-if in order to just surface a single implementation where necessary.

* Use cfg-if to select a single implementation
* Add a note in the README that macOS needs to select an implementation.
@tomhoule
Copy link
Contributor

I wrote my reaction to the opinions in #237 (comment) — but tl;dr I like the approach in this PR.

@esheppa
Copy link
Contributor

esheppa commented Aug 31, 2023

It could be interesting to add a test in the github actions to ensure this behavior isn't broken later (cargo hack check --feature-powerset with a few feature exclusions is also nice for this)

@khanage
Copy link
Author

khanage commented Aug 31, 2023

Thanks @tomhoule I've updated documentation and also noticed that we might not want any TLS implementation by looking through #305 so I've added a check to see if native-tls is on at all.

@tomhoule
Copy link
Contributor

There are test errors in CI, but they look unrelated.

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.

3 participants