gpt4 book ai didi

azure - 无法连接到 Azure SQL-Server : sun. security.validator.ValidatorException

转载 作者:行者123 更新时间:2023-12-03 02:46:02 29 4
gpt4 key购买 nike

创建了一台 Azure SQL Server 计算机,我能够进行 rdp 并通过本地 SQL Server Mgt Studio 客户端进行连接。

但是,我无法使用下面的连接字符串通过 Java 代码连接到同一实例。

  • 我正在使用最新的 JDBC 驱动程序 (Microsoft JDBC Driver 7.4)
  • 我使用的是 SQL Server 2017 Express
  • 我可以通过本地计算机上的 SQL Server Mgt Studio 客户端手动连接

这是错误消息:

com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:xxxxxxxxxxxxxxxxxx

这是连接字符串:

jdbc:sqlserver://Server=nn.nnn.nnn.nnn;Integrated Security=false;User ID=myusername;Password=mypassword

感谢您的帮助!

最佳答案

我通过更改连接字符串来使其工作:

encrypt=true

进入

encrypt=false

不确定这是最好的解决方案,但至少我可以继续开发。

关于azure - 无法连接到 Azure SQL-Server : sun. security.validator.ValidatorException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58768736/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com