Vai*_*ain 5 java sql sql-server jdbc
我通过Java程序连接到Sql Server 2008和2008+
DriverManager.getConnection("jdbc:sqlserver://<Ip>;instance=MSSQLSERVER;domain=<domain>;IntegratedSecurity=true;ssl=request;", "administrator", "password");我能够成功连接.但是当我通过sql server配置管理器在sql server中启用Force加密为true时.
com.microsoft.sqlserver.jdbc.SQLServerException: An existing connection was forcibly closed by the remote host ClientConnectionId:xxxx
Run Code Online (Sandbox Code Playgroud)
仅供参考:我已经尝试在连接字符串中添加以下参数.
编辑1
- 另一个重点 - 它只发生在Windows身份验证中(通过IntegratedSecurity = true;在连接字符串中启用).所以这种情况只有在Force加密设置为true并且我们尝试以Windows身份验证模式连接时才会发生.
@Vivien @MarkRotteveel 感谢您的回答,给了我方向。
事实证明,版本低于11.0的sql server遇到了麻烦,作为sql server 11.0版本的一部分,进行了各种改进,纠正了windows身份验证+加密连接连接的错误。
因此,Sql Server 2012 及更高版本将支持使用 TLSv1.2 的 Windows 身份验证、Windows 身份验证以及无缝的加密连接。现在我正在使用
| 归档时间: |
|
| 查看次数: |
467 次 |
| 最近记录: |