tiberius
tiberius copied to clipboard
An error occured during the attempt of performing I/O: tls handshake eof
Hi There,
I'm trying to perform simple query against MSSQL server, but getting:
An error occured during the attempt of performing I/O: tls handshake eof
Any idea what could be wrong on the following code?
main.rs
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let mut config = tiberius::Config::new();
config.host("127.0.0.1");
config.port(8089);
config.database("SOMEDATABASE");
config.authentication(tiberius::AuthMethod::sql_server("SOMEUSER", "SOMEPASSWORD"));
config.trust_cert();
let tcp = TcpStream::connect(config.get_addr()).await?;
tcp.set_nodelay(true)?;
let mut client = Client::connect(config, tcp).await?;
Ok(())
}
Cargo.toml
[dependencies]
tokio = { version = "1.24.1", features = ["full"] }
anyhow = "1"
tiberius = { version = "0.11", features = [
"chrono",
"rustls",
"tds73",
], default-features = false }
async-std = "1.12.0"
[dependencies.tokio-util]
version = "0.7.7"
features = ["compat"]
Probably server TLS and rustls don't co-operate very well. Did you try with native-tls and OpenSSL?