2016-08-21 99 views
0

我有Jersey應用程序,它使用Jersey客戶端來請求服務器。服務器使用客戶端證書和基本身份驗證進行通信。我有證書在GlassFish中Java澤西島不發送ssl客戶端證書

服務器證書鏈安裝信任庫和密鑰庫正確: 服務器證書 - > CA國際 - > CA

客戶端證書鏈: 客戶端證書 - > CA國際 - > CA

CA是自行創建/簽署的證書,而不是來自供應商。

信任:

1)CA

2)CA間

密鑰庫:

1)具有完整鏈的客戶端證書

代碼:(存儲在環境中設置)

sSLContext = SslConfigurator.newInstance().securityProtocol("TLSv1.2").createSSLContext(); 
HttpAuthenticationFeature authFeature = HttpAuthenticationFeature.basic("user", "pass"); 
client = ClientBuilder.newBuilder().sslContext(sSLContext).build(); 
client.register(authFeature); 

所有證書和鏈都已正確加載。

然而,當我提出要求,我得到

Info: Warning: no suitable certificate found - continuing without client authentication 

,然後我得到handshake_failure錯誤

我得到這些其他錯誤

Info: http-listener-1(3), setSoTimeout(0) called 
Info: Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for TLSv1 
Info: Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for TLSv1 
Info: Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256 for TLSv1 
Info: Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 for TLSv1 
Info: Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 for TLSv1 
Info: Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 for TLSv1 
Info: Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for TLSv1 
Info: Ignoring unsupported cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 for TLSv1.1 
Info: Ignoring unsupported cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 for TLSv1.1 
Info: Ignoring unsupported cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256 for TLSv1.1 
Info: Ignoring unsupported cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 for TLSv1.1 
Info: Ignoring unsupported cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 for TLSv1.1 
Info: Ignoring unsupported cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 for TLSv1.1 
Info: Ignoring unsupported cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 for TLSv1.1 

我已經安裝了無限chiper擴展並檢查它的工作。仍然得到這些。

我也檢查了瀏覽器上的證書,我能夠通過瀏覽器連接到服務器並使用相同的證書獲取數據。

如何讓2路ssl工作?

回答

0

客戶端和服務器都需要在其各自信任庫中的CA證書。我會說服務器沒有。

當服務器請求客戶端證書,發送其信任的CA的列表,並且如果客戶端無法找到其中一人簽署的證書不發一個,

+0

我有兩個密鑰庫的cacerts .jks和keystore.jks,客戶的信任庫是什麼?我在服務器和客戶端鏈中都有CA和CA inter並且它們匹配。我有ca-certs.pem作爲apache服務器中的證書鏈集。包含CA證書。我已經驗證了服務器證書請求類型與客戶端中的一個存在匹配 – Akshit