I encounter a post-login timeout when connecting from a .NET 8 Docker container to an old SQL Server with TLSv1 enabled. Testing sample:
using System;
using DbAccessLib;
class ConnectionTester {
static void VerifyConnection() {
var conn = new DbConnector("Server=oldServer;Database=Archive;User=Importer;Password=secret;TrustCert=True;Encrypt=False");
conn.Open();
Console.WriteLine("Connection successful");
conn.Close();
}
static void Main() => VerifyConnection();
}
During my work with legacy SQL Server instances and modern .NET environments, I encountered a similar timeout issue due to the default security protocol settings in .NET 8. My investigation revealed that the container’s runtime enforces newer TLS versions, which in turn prevents establishing a connection with servers that only support TLSv1. I found that explicitly configuring the legacy server or adjusting client-side security settings, albeit temporarily, can resolve the issue. It is advisable though to update the SQL Server’s security protocols whenever possible to ensure long-term system reliability and security.
hey, i had simlar issues. fixed it by adding explicit tls settings in startup code before connection. you might also need to tweak your container config for old protcols support. not perfect long-term, but works while updating your sql server.