tiberius icon indicating copy to clipboard operation
tiberius copied to clipboard

Use a single TLS implementation

Open khanage opened this issue 2 years ago • 4 comments

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.

khanage avatar Aug 31 '23 08:08 khanage

I wrote my reaction to the opinions in https://github.com/prisma/tiberius/pull/237#issuecomment-1700892327 — but tl;dr I like the approach in this PR.

tomhoule avatar Aug 31 '23 11:08 tomhoule

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)

esheppa avatar Aug 31 '23 12:08 esheppa

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.

khanage avatar Aug 31 '23 12:08 khanage

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

tomhoule avatar Aug 31 '23 14:08 tomhoule