簡體   English   中英

如何解決受信任證書上的SSLHandshakeException?

[英]How to resolve SSLHandshakeException on a trusted certificate?

我們有一個JavaFX應用程序在https安全資源上調用我們的后端。 應用程序連續對同一個URL執行數百個請求,以從服務器獲取數據。

這通常沒有問題,但現在我們有一個客戶在連接到資源時報告SSLHandshakeException問題。 他可以做幾百個請求就好了,下一個,客戶端失敗了:

javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: Java couldn't trust Server 
    at 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 sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.access$200(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$9.run(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$9.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessController.doPrivileged(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
    at com.project.common.ws.client.HttpUrlConnectionRestClient.b(ProGuard:339)
    at com.project.common.ws.client.HttpUrlConnectionRestClient.a(ProGuard:227)
    at com.project.common.ws.client.HttpUrlConnectionRestClient.a(ProGuard:56)
    at com.project.common.ws.client.HttpUrlConnectionRestClient.a(ProGuard:387)
    at com.project.projects.map.client.manager.GeomanagerWorker.readGeocodingChunk(ProGuard:5640)
    at com.project.projects.map.client.manager.n.readGeocodingChunk(ProGuard:4337)
    at com.project.projects.map.client.manager.modules.fx.imports.b.nF(ProGuard:199)
    at com.project.projects.map.client.manager.modules.fx.imports.b.call(ProGuard:174)
    at javafx.concurrent.Task$TaskCallable.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.security.cert.CertificateException: Java couldn't trust Server 
    at com.sun.deploy.security.X509TrustManagerDelegate.checkTrusted(Unknown Source)
    at com.sun.deploy.security.X509Extended7DeployTrustManagerDelegate.checkServerTrusted(Unknown Source)
    at com.sun.deploy.security.X509Extended7DeployTrustManager.checkServerTrusted(Unknown Source)
    ... 30 more

我們的SSL證書由GeoTrust SSL CA-G3簽署,有效期至2016年12月13日。客戶客戶端使用Java 1.8.0_40

我研究了不同的文章。 這個說,它可能與證書域名的區分大小寫的錯誤有關。 但我們在證書和請求上都使用了所有小寫,所以應該沒問題。

文章表示,這個問題可能是因為“也許新的Java版本更嚴格執行SSL中科院”相關的Java版本。 它也說,升級到最新的java版本可能會解決問題。 我還沒有檢查這個選項,因為由於公司的IT限制,客戶並不總是可以升級java版本。

更重要的是,我們需要運行Java Version 1.8,如果它不能與1.8.0_40版本一起使用,那就太糟糕了。

有誰知道,如果有這個問題的確切原因?

我遇到過同樣的問題。 為了讓ASDM-IDM連接器正常工作,我不得不降級到Java 1.6。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM