无法使用SSMS以外的任何内容连接到SQL Server 2016 SP1



在过去的11个小时里,我一直在努力,但我仍然弄不明白。它最初是一个JAVA连接问题,但在这一点上,我能够确认,唯一能够连接到远程SQL Server实例的工具是SQL Server Management Studio。JDBC失败,Windows 7 ODBC失败,Linux的DataStage客户端失败,Visual Studio 2017数据连接也失败。以下是适用于其他服务器的示例.Net代码(C#(,除了我遇到的问题:

[TestCase(true)]
[TestCase(false)]
public void TestMethod(bool encrypt)
{
var sscsb = new SqlConnectionStringBuilder {
DataSource = $"{server}\{instance},{port}",
NetworkLibrary = "dbmssocn",
PacketSize = 4096,
InitialCatalog = database,
IntegratedSecurity = false,                
UserID = user,
Password = password,
Encrypt = encrypt,
TrustServerCertificate = true,                
};
try
{
using (var conn = new SqlConnection(sscsb.ConnectionString))
{
conn.Open();
}
Assert.Pass("Connected");
}
catch (Exception e)
{
Assert.Fail(e.Message);
}
}

尝试从这个测试类连接时返回的错误很简单:

Message: Login failed for user 'etldstg'.

在JAVA中,根据TLS设置的组合(请注意,登录总是使用自签名证书加密(,我有时会得到以下信息:

The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "SQL Server did not return a response. The connection has been closed. ClientConnectionId:37dc2f52-c952-4f50-8fc9-62c3bdd84041".

我知道JAVA不支持DHE密码

Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_128_GCM_SHA256 Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_GCM_SHA384 Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384

在这一点上,我不能要求服务器管理员遵循微软的建议,并通过注册表黑客禁用DHE

所以,我被卡住了。有人见过类似的东西吗?你是如何解决的?

首先检查服务器之间网络上的路由是否打开。

如果是,则是另一个问题,您可以询问管理员查看TCP/IP协议在SQL Server实例上是否处于活动状态。您可以通过打开服务器上的SQL Server配置管理器并检查网络协议来执行此操作。

最新更新