on ‎2016 Nov 03 9:43 AM
how can i check all included certificates? and is there any possibility to fix this error ?
INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1886) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:276) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:270) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1341) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:153) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.Handshaker.process_record(Handshaker.java:804) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at java.io.FilterOutputStream.write(FilterOutputStream.java:97) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.apache.commons.httpclient.methods.ByteArrayRequestEntity.writeRequest(ByteArrayRequestEntity.java:90) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.springframework.ws.transport.http.CommonsHttpConnection.onSendAfterWrite(CommonsHttpConnection.java:114) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.springframework.ws.transport.AbstractWebServiceConnection.send(AbstractWebServiceConnection.java:47) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.springframework.ws.client.core.WebServiceTemplate.sendRequest(WebServiceTemplate.java:622) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:585) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:537) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | ... 268 more INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.validator.Validator.validate(Validator.java:260) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:326) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1323) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | ... 291 more INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:196) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:268) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380) INFO | jvm 1 | main | 2016/11/03 04:41:59.601 | ... 297 more
Request clarification before answering.
If you are trying to connect from your Hybris instance to a service through HTTPS and getting this exception, then you need to export the SSL certificate from the server running the service and import it into your Java Keystore.
Export the the signed certificate from the server:
openssl s_client -connect <server>:<port> -showcerts
This will output the certificate details. Copy the section between:
-----BEGIN CERTIFICATE-----
and:
-----END CERTIFICATE-----
(including the BEGIN and END lines)
Save this block to a file, e.g. my-cert.pem.
Then import this file to your Java Keystore:
keytool -import -trustcacerts -alias my-cert -file /path/to/my-cert.pem -keystore <JAVA_HOME>/lib/security/cacertsRestart your Hybris application, now it will be able to connect to the server.
You can refer to this article for more details on this procedure: How to Import Self-Signed Certificates into Java Keystore for Local Development.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Install a keystore on your server.This keystore will have certificate. {jdk1.8.0_60}\bin\keytool.exe -genkey -keyalg RSA -alias arcodatahub -keystore keystore -validity 365 -keysize 2048
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.