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

macOS 15 + SQL Server 2014 doesn't work #364

Open
kzhui125 opened this issue Oct 22, 2024 · 2 comments
Open

macOS 15 + SQL Server 2014 doesn't work #364

kzhui125 opened this issue Oct 22, 2024 · 2 comments

Comments

@kzhui125
Copy link

I have tested rustls/vendored-openssl feature, it doesn't work for macOS 15 connecting to SQL Server 2014 in Windows Server 2012 R2

[target.'cfg(not(windows))'.dependencies.tiberius]
version = "0.12"
default-features = false
features = ["rustls", "tds73", "winauth", "chrono", "rust_decimal"]
@NTmatter
Copy link

Can you share the error you're seeing? That might help narrow things down.

Out of curiousity, does it work without the winauth feature?

@kzhui125
Copy link
Author

[dependencies]
tiberius = { version = "0.12", default-features = false, features = [
    # "rustls",
    # "native-tls",
    "vendored-openssl",
    "tds73",
] }
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["compat"] }

tested without winauth , and tested with rustls, native-tls, vendored-openssl

use tiberius::{AuthMethod, Client, Config, EncryptionLevel};
use tokio::net::TcpStream;
use tokio_util::compat::TokioAsyncWriteCompatExt;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut config = Config::new();

    config.host("192.168.50.74");
    config.port(1433);
    config.authentication(AuthMethod::sql_server("user", "password"));
    config.encryption(EncryptionLevel::Off);
    config.trust_cert();

    let tcp = TcpStream::connect(config.get_addr()).await?;
    tcp.set_nodelay(true)?;

    let _client = match Client::connect(config, tcp.compat_write()).await {
        // Connection successful.
        Ok(client) => client,
        Err(e) => Err(e)?,
    };

    Ok(())
}

rustls

Error: Io { kind: UnexpectedEof, message: "tls handshake eof" }

native-tls

get error after long time:

Error: Tls("connection closed via error")

vendored-openssl

Error: Tls("unexpected EOF")

version:

sql server version:

SELECT @@VERSION
Microsoft SQL Server 2014 (SP2) (KB3171021) - 12.0.5000.0 (X64)   Jun 17 2016 19:14:09   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor) 

openssl:

openssl -v
OpenSSL 3.3.2 3 Sep 2024 (Library: OpenSSL 3.3.2 3 Sep 2024)
image

Thanks @NTmatter

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