日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Path does not chain with any of the trust anchors

發布時間:2025/3/19 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Path does not chain with any of the trust anchors 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

報錯信息

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.at sun.reflect.GeneratedConstructorAccessor34.newInstance(Unknown Source)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)at java.lang.reflect.Constructor.newInstance(Unknown Source)at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:59)at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:103)at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:149)at com.mysql.cj.exceptions.ExceptionFactory.createCommunicationsException(ExceptionFactory.java:165)at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:355)at com.mysql.cj.protocol.a.NativeAuthenticationProvider.negotiateSSLConnection(NativeAuthenticationProvider.java:789)at com.mysql.cj.protocol.a.NativeAuthenticationProvider.proceedHandshakeWithPluggableAuthentication(NativeAuthenticationProvider.java:499)at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:217)at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1411)at com.mysql.cj.NativeSession.connect(NativeSession.java:165)at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:982)at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:852)... 6 more Caused by: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchorsat sun.security.ssl.Alerts.getSSLException(Unknown Source)at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)at sun.security.ssl.Handshaker.fatalSE(Unknown Source)at sun.security.ssl.Handshaker.fatalSE(Unknown Source)at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)at sun.security.ssl.Handshaker.processLoop(Unknown Source)at sun.security.ssl.Handshaker.process_record(Unknown Source)at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)at com.mysql.cj.protocol.ExportControlled.performTlsHandshake(ExportControlled.java:213)at com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake(StandardSocketFactory.java:206)at com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake(NativeSocketConnection.java:99)at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:350)... 13 more Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchorsat com.mysql.cj.protocol.ExportControlled$X509TrustManagerWrapper.checkServerTrusted(ExportControlled.java:280)at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(Unknown Source)... 25 more Caused by: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchorsat sun.security.provider.certpath.PKIXCertPathValidator.validate(Unknown Source)at sun.security.provider.certpath.PKIXCertPathValidator.engineValidate(Unknown Source)at java.security.cert.CertPathValidator.validate(Unknown Source)at com.mysql.cj.protocol.ExportControlled$X509TrustManagerWrapper.checkServerTrusted(ExportControlled.java:273)... 26 more

解決

不建議在沒有服務器身份驗證的情況下建立SSL連接。根據MySQL 5.5.45+、5.6.26+和5.7.6+的要求,

如果不設置顯式選項,則必須建立默認的SSL連接。需要通過設置useSSL=false來顯式禁用SSL,

或者設置useSSL=true并為服務器證書驗證提供信任存儲。

找到數據連接的url,這里是ssm整合時的配置文件中

將useSSL=true改為useSSL=false

<!-- 定義數據源Bean --><!-- Druid --><bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"><property name="url"value="jdbc:mysql://localhost:3306/ssmtest?characterEncoding=UTF-8&amp;useSSL=false" /><property name="username" value="root" /><property name="password" value="123" /></bean>

?

總結

以上是生活随笔為你收集整理的Path does not chain with any of the trust anchors的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。