加入收藏 | 设为首页 | 会员中心 | 我要投稿 常州站长网 (https://www.0519zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql-server – 为安全(SSL)连接配置的MS SQL Server允许从JDBC客

发布时间:2020-12-31 06:12:31 所属栏目:MsSql教程 来源:网络整理
导读:我需要使用安全通信连接到MS SQL Server 2008 r2.我已经能够使用以下连接字符串执行相同的操作: jdbc:sqlserver://db server name:1433;databaseName=db name;selectMethod=cursor;encrypt=true;trustServerCertificate=false;integratedSecurity=false;t

我需要使用安全通信连接到MS SQL Server 2008 r2.我已经能够使用以下连接字符串执行相同的操作:

jdbc:sqlserver://<<db server name>>:1433;databaseName=<<db name>>;selectMethod=cursor;encrypt=true;trustServerCertificate=false;integratedSecurity=false;trustStore=<<path to my trust store>>;trustStorePassword=<<password>>

在数据库服务器上,我使用Configuration Manager指定要使用的证书并启用“强制加密”
SQL Server配置管理器 – > SQL Server网络配置 – > <>的协议 – 右键单击?? – >属性 – >强制加密和证书

但是,我可以连接到同一个数据库,而无需使用以下URL指定’encrypt = true’:

jdbc:sqlserver://<<db server name>>:1433;databaseName=<<db name>>;selectMethod=cursor;

我的困惑是,当SQL Server配置为安全连接时,它不应该拒绝/忽略非加密连接.或者我是否需要进行附加配置,以便DB服务器仅接受安全连接

感谢致敬
P Manchanda

解决方法

不会.根据文档,它将具有加密连接.

检查http://social.msdn.microsoft.com/Forums/sqlserver/en-US/bde679d9-ff83-4fa7-b402-42e336a97106/force-encryption-on-sql-server-not-working

When the Force Encryption option for the Database Engine is set to
YES,all communications between client and server is encrypted no
matter whether the “Encrypt connection” option (such as from SSMS) is
checked or not. You can check it using the following DMV statement.

就像这样 – 您的连接字符串设置被忽略.

这可以在服务器上通过以下方式检查:

USE master
GO
SELECT encrypt_option FROM sys.dm_exec_connections
GO

(编辑:常州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读