Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValidatorException connecting to self-signed locally running HTTPS service #48

Closed
rubin55 opened this issue Feb 23, 2016 · 12 comments
Closed

Comments

@rubin55
Copy link

rubin55 commented Feb 23, 2016

RESTClient 3.5.1 snapshot, tested with 3.5.0 also.

I'm getting a ValidatorException, even though I tell rest-client to not do hostname verification and to ignore self-signed certificates. The service is a locally running IBM WebSphere 8.5. See below for the backtrace!

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 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 at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.wiztools.restclient.HTTPClientRequestExecuter.execute(HTTPClientRequestExecuter.java:417) at org.wiztools.restclient.ui.RESTViewImpl$3.run(RESTViewImpl.java:339) Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387) at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292) at sun.security.validator.Validator.validate(Validator.java:260) at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324) at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229) at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:105) at org.apache.http.ssl.SSLContextBuilder$TrustManagerDelegate.checkServerTrusted(SSLContextBuilder.java:298) at sun.security.ssl.AbstractTrustManagerWrapper.checkServerTrusted(SSLContextImpl.java:922) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491) ... 20 more Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:146) at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131) at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280) at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382) ... 28 more

@HassanBakri
Copy link

Me too it would be great to disable Certificate Path Creation
Because Some Enterprise Require Connection Under SSL and no need for Signed Certificate From CA

@subwiz
Copy link
Member

subwiz commented Apr 26, 2016

There seems to be solution: http://stackoverflow.com/questions/24720013/apache-http-client-ssl-certificate-error

Will look into it..

subwiz pushed a commit that referenced this issue Apr 28, 2016
@subwiz
Copy link
Member

subwiz commented Apr 28, 2016

Reporters: can you please take the latest code and let me know if my fix fixes the problem? Based on your advice, I will change the UI messages.

subwiz added a commit that referenced this issue May 5, 2016
…errors (instead of just self-signed certificate).
@subwiz
Copy link
Member

subwiz commented May 5, 2016

This should hopefully fix it.

rc

@kamalmul
Copy link

kamalmul commented May 5, 2016

How do I download this latest version to test?

@subwiz
Copy link
Member

subwiz commented May 5, 2016

I built it and uploaded in the temporary location: https://dl.dropboxusercontent.com/u/2505020/restclient-ui-fat-3.5.1-SNAPSHOT.jar

@kamalmul
Copy link

kamalmul commented May 5, 2016

It is working now! Awesome!
Thank you Subwiz!

@subwiz
Copy link
Member

subwiz commented May 5, 2016

:)

@subwiz subwiz closed this as completed May 5, 2016
@rubin55
Copy link
Author

rubin55 commented May 6, 2016

Hi, I just did a pull of master, checked with git lola that the commit is in there (#4a3ca8b) and did a dist-build; however, I don't see the option as you put it in the screenshot but only the old "Trust self-signed certificate?". I'm on Linux, using GTK. Am I doing something obviously wrong? I also checked to run but I get the same backtrace also.

@subwiz
Copy link
Member

subwiz commented May 6, 2016

I re-uploaded the build to: https://dl.dropboxusercontent.com/u/2505020/restclient-ui-fat-3.5.1-SNAPSHOT.jar You may take it from here!

@rubin55
Copy link
Author

rubin55 commented May 6, 2016

I got it and it works! But, why doesn't it work if I build from master?

@subwiz
Copy link
Member

subwiz commented May 6, 2016

I'm not sure. I moved to Gradle recently (from Maven), and it is working fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants