Problem of running SSLClientWithClientAuthExample
Hi David,
When I run SSLClientWithClientAuthExample and SSLServerWithClientAuthExample, I have got the following exception.
How can I solve Problem.
thanks
Jacky
The stack trace on the client side:
Exception in thread "main" javax.net.ssl.SSLHandshakeException:sun.security.v alidator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE xception: unable to find valid certificaiton path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.jav a;192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl .java:1868)
at sun.security.ssl.Handshaker.fatalSE(Handshader.jav a;276)
at sun.security.ssl.Handshader.fatalSE(Handshader.jav a:270)
at sun.security.ssl.ClientHandshader.serverCertufucat e(ClientHandshader.java:1337)
at sun.security.ssl.ClientHandshader.processMessage(C lientHandshaker.java:154)
at sun.security.ssl.Handshader.processLoop(Handshader .java:868)
at sun.securiity.ssl.handshader.process_record(handsh ader.java:804)
at sun.securiyt.ssl.SSLSocketImpl.readRecord(SSLSocke tImpl.java:998)
at sun.securiyt.ssl.SSLSocketImpl.performInitialHands hake(SSLSocketImpl.java:1294)
at sun.securiyt.ssl.SSLSocketImpl.writeRecord(SSLSock etImpl.java:685)
at sun.securiyt.ssl.AppOutputStream.write(AppOutputSt ream.java:111)
at java.io.OutputStream.write(OutputStream.java:75)
at chapter10.SSLClientExampe.doProtocol(SSLClientExam ple.java:26)
at chapter10.SSLClientWithClientAuthExample.main(SSLC lientWithClientAuthExample.java:47)
caused by:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderE xception:unable to find valid certificaiton path to requested target.
at sun.security.validator.PKIXValidator.doBuild(PKIXV alidator.java:385)
at sun.security.validator.PKIXValidator.engineValidat e(PKIXValidator.java:292)
at sun.security.validator.Validator.Validate(PKIXVali dator.java:260)
at sun.security.ssl.X509TrustManagerImpl.validate(X50 9TrustmanageImpl.java:326)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted (X509TrustmanageImpl.java:231)
at sun.security.ssl.X509TrustManagerImpl.checkServerT rusted(X509TrustmanageImpl.java:126)
at sun.security.ssl.ClientHandshaker.serverCertificat e(CleintHandshader.java:1319)
The stack trace on the server side:
Exception in thread "main" javax.net.ssl.SSLHandshadeException:Receive fatal alert: certificate_unknow
at sun.security.ssl.Alerts.getSSLException(Alerts.jav a:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.jav a:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocket Impl.java:1943)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocke tImpl.java:1059)
at sun.security.ssl.SSLSocketImpl.performInitialHands hade(SSLSocketImpl.java:1294)
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSock etImpl.java:685)
at java.io.OutputStream.write(OutputStream.java:75)
at chatper10.SSLServerExample.doProtocol(SSLServerExa mple.java;29)
at chatper10.SSLServerWithClientAuthExample.main(SSLS erverWithClientAuthExampe.java:24)
|