報的錯誤信息如下:
[08S01] 驅動程序無法通過使用安全套接字層(SSL)加密與 SQL Server 建立安全連接。錯誤:“PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”。 ClientConnectionId:721941c7-3e08-4e80-bc56-418e1c051624 sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
查了一些解決辦法,都不怎麼奏效。原來只需要一個設置就行了,如下圖,只需要設置 trustServerCertificate 即可解決問題。