“Encrypt”属性设置为“true”且 “trustServerCertificate”属性设置为“false”,但驱动程序无法使用安全套接字层 (SSL) 加密与 SQL Server 建立安全
我们先不管原理是什么,解决的方法是找出你连接数据库的代码。在后面加上encrypt=false就可以了。
·
com.microsoft.sqlserver.jdbc.SQLServerException: “Encrypt”属性设置为“true”且 “trustServerCertificate”属性设置为“false”,但驱动程序无法使用安全套接字层 (SSL) 加密与 SQL Server 建立安全连接:错误:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target。 ClientConnectionId:235f4c8c-84dd-41c5-9e44-f39b34dca841
at
我们先不管原理是什么,解决的方法是找出你连接数据库的代码
privat static final string?= "jdbc:sqlserver://localhost:1433;databaseName=StudentDB_New";

在后面加上encrypt=false就可以了
private static final String URL = "jdbc:sqlserver://localhost:1433;databaseName=StudentDB_New;encrypt=false";
更多推荐

所有评论(0)