-
Notifications
You must be signed in to change notification settings - Fork 127
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
Connection Failure with MSSQL: Special Character Password #333
Comments
Does it work if you urlencode the special character? |
By hand: use anyhow::Result;
use tiberius::Client;
use tiberius::Config;
use tokio::net::TcpStream;
use tokio_util::compat::TokioAsyncWriteCompatExt;
const CONNECTION_STRING: &str = r"Server=sql.foo.com,999;Database=Database;UID='User';PWD='Password%241337'";
#[tokio::main]
async fn main() -> Result<()> {
let mut config = Config::from_ado_string(CONNECTION_STRING)?;
config.trust_cert();
let tcp = TcpStream::connect(config.get_addr()).await?;
tcp.set_nodelay(true)?;
let _ = Client::connect(config, tcp.compat_write()).await?;
Ok(())
} It does not. |
Update: By using wireshark and setting encryption to What is interesting is that SqlCmd uses an older version of the pre login message. SqlCmd uses version: 0.0.1537 Should this be a cause for concern? |
I have exactly the same behavior with another password in the form : BlaBla%99 |
Summary
I'm encountering a connection issue when attempting to tiberius to connect to a Microsoft SQL Server. This issue does not arise when connecting via
php
orsqlcmd
with the same credentials.Detailed Description
I have successfully connected to the MSSQL server using both php and sqlcmd commands, indicating that the server is accessible and the credentials are correct. The connection details include a password that contains the special character $ followed by numbers, which I suspect might be related to the issue. Here are examples of the successful connection attempts for reference:
sqlcmd
:php
:However, attempting the same connection using this library:
Fails with the following error message:
Environment
Server: Microsoft SQL Server 2019 (RTM-CU19) (KB5023049 - 15.0.4298.1 (X64))
Issue Analysis
The error suggests a login failure, which is peculiar given that the same credentials work with other methods. The inclusion of a special character in the password and its handling within the Rust environment might be contributing factors but I'm not sure.
The text was updated successfully, but these errors were encountered: