我需要使用安全通信连接到MS SQL Server 2008 R2。 我已经能够使用下面的连接string来做同样的事情:
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>>
在数据库服务器上,我使用configurationpipe理器来指定要使用的证书,并启用“强制encryption”SQL Serverconfigurationpipe理器 – > SQL Servernetworkingconfiguration – >协议为<> – 右键单击 – >属性 – >强制encryption和证书
但是,我可以连接到相同的数据库,而不指定使用以下URL的“encrypt = true”:
jdbc:sqlserver://<<db server name>>:1433;databaseName=<<db name>>;selectMethod=cursor;
我的困惑是,当SQL Server已被configuration为安全连接,不应该拒绝/忽略非encryption连接。 或者我需要做附加configuration,因此数据库服务器只接受安全连接
感谢和问候P Manchanda
根据文件,它将有一个encryption的连接。
当数据库引擎的强制encryption选项设置为YES时,无论是否选中“encryption连接”选项(如来自SSMS),客户端和服务器之间的所有通信都将被encryption。 你可以使用下面的DMV语句来检查它。
这样简单 – 您的连接string设置将被忽略。
这可以通过以下方式在服务器上检查:
USE master GO SELECT encrypt_option FROM sys.dm_exec_connections GO