当前位置:   article > 正文

sqlserver.jdbc.SQLServerException: 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接_failed to obtain jdbc connection; nested exception

failed to obtain jdbc connection; nested exception is com.microsoft.sqlserve

springboot+mybatis+sqlserver进行开发时遇到下列问题:
Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: 驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”。 ClientConnectionId:54e7d01d-ffd4-4eed-ae10-77f70ba1ac28] with root cause
网上搜索,看到其他博主在官网找到解决方案,地址:

​ ​https://blogs.msdn.microsoft.com/dataaccesstechnologies/2016/11/30/intermittent-jdbc-connectivity-issue-the-driver-could-not-establish-a-secure-connection-to-sql-server-by-using-secure-sockets-layer-ssl-encryption-error-sql-server-returned-an-incomplete-respons/ ​​

看到“该问题仅在使用低于 4.2 版的旧 JDBC 驱动程序时才会出现。”

那就试一下吧。将pom.xml中的依赖注释掉:

<dependency> <groupId&g

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/791143
推荐阅读
相关标签
  

闽ICP备14008679号