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

Unencrypted traffic despite encrypt=true due to TLS feature flags disablement #305

Open
willbush opened this issue Aug 8, 2023 · 3 comments

Comments

@willbush
Copy link

willbush commented Aug 8, 2023

I was playing around with wireshark and comparing sql auth (username / password) on linux in this library to Microsoft.Data.SqlClient in C#.

The code I was testing just performs login / disconnect to the database in both C# and Rust.

I was puzzled as to why the traffic using Tiberius was unencryped despite me using encrypt=true in the ADO.NET connection string.

I realized it was because I used default-features = false and did not opt backin to one of the TLS feature flags:

tiberius = { version = "0.12", default-features = false, features = ["tds73", "sql-browser-tokio", "time"] }

I'm filing an issue because perhaps this should be a panic at runtime?

@tomhoule
Copy link
Contributor

Hi @willbush , thanks for reporting this. I agree.

We could also error at compile time in case none of the TLS features is selected, but it is legit to not want encryption at all, and we can't know the intent before runtime, so I agree it should be a runtime error. Probably a regular error upon connecting, or do you think a panic would be preferable?

@willbush
Copy link
Author

Sure, I think a regular error is fine.

@willbush
Copy link
Author

willbush commented Aug 28, 2023

we can't know the intent before runtime

Could no encryption be a opt-in feature flag? Then perhaps it could be compile time. I guess that would be an API breaking change though.

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

2 participants