Datagrip连接SQLServer失败
方法一:选择 jTds 驱动程序

方法二:降低驱动版本

方法三:网上其它乱七八糟的尝试
尝试直接设置连接字符串如下:
jdbc:sqlserver://localhost:1433;DatabaseName=dbname;encrypt=true;trustServerCertificate=true
连接不上的提示

断点调试时,报SQLException,com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client preferences [TLS13, TLS12]”。 ClientConnectionId:237b3165-e4b7-463b-9df7-533bf8facbc8
百度后可能的原因是 jre 的配置,参考如下文档调整:
-
找到目标文档 \Eclipse Adoptium\jdk-8.0.352.8-hotspot\jre\lib\security\java.security
-
移除 TLSv1, TLSv1.1, 3DES_EDE_CBC

-
重启项目
参照
[(177条消息) 启动项目,报错:The server selected protocol version TLS10 is not accepted by client preferences [TLS12]解决办法_dangerous317的博客-CSDN博客]( https://blog.csdn.net/dangerous317/article/details/122172334?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165632456516780366592393%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=165632456516780366592393&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~pc_rank_34-1-122172334-null-null.142%5Ev24%5Epc_rank_34 ,157%5Ev15%5Enew_3&utm_term=:%E2%80%9CThe%20server%20selected%20protocol%20version%20TLS10%20is%20not%20accepted%20by%20client%20preferences%20%5BTLS12%5D&spm=1018.2226.3001.4187)

浙公网安备 33010602011771号