tiberius: Connecting to Azure SQL with tokio (on mac) gives a Tls connection closed via error.
this is my code
let mut config = Config::from_ado_string("server=xxx.database.windows.net,1433;UID=xxx;PWD=xxx;TrustServerCertificate=true")?;
let tcp = TcpStream::connect(config.get_addr()).await?;
tcp.set_nodelay(true)?;
let mut client = Client::connect(config, tcp.compat_write()).await.expect("Failed!");
and I get
thread 'main' panicked at 'Failed!: Tls("connection closed via error")', src/main.rs:80:22
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (10 by maintainers)
Hey all! TLS should now work on macOS systems. With no additional feature flags you must have OpenSSL installed to your system before compiling Tiberius. You can also use a feature flag
vendored-openssl
to use the vendored version from crates.io, which links to it statically. This is probably not the best thing security-wise, but if you’re not running a macOS server, only using it for development, why not?Please open up a new issue if having problems.
OH! Damn it - i’m so sorry! I had tiberius in my shared types folder for some macro magic where i didn’t set the correct feature flags. Everything works now as expected. Thank you!