我已经做了11个小时了,但我还是想不通。它最初是一个JAVA连接问题,但在这一点上,我能够确认,唯一能够连接到远程SQL Server实例的工具是SQL Server Management Studio。JDBC失败,Windows7ODBC失败,Linux的DataStage客户端失败,Visual Studio2017数据连接也失败。以下是适用于其他服务器的示例.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
在这一点上,我不能要求服务器管理员遵循微软的建议和Disable DHE by registry hacking
所以,我被卡住了。有没有人看到过类似的东西?你是怎么解决这个问题的?
发布于 2018-07-12 17:24:33
首先检查您的网络上服务器之间的路由是否打开。
如果是,这是另一个问题,您可以要求管理员查看SQL Server实例上的TCP/IP协议是否处于活动状态。为此,可以在服务器上打开SQL Server配置管理器并检查网络协议。
https://stackoverflow.com/questions/51300024
复制相似问题