Issue when using InstallCert For SSLCertification

大兔子大兔子 提交于 2019-12-12 01:29:43

问题


I was trying to send a post request on a url from server then it showed following errors

 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

Then I found about InstallCert.java( https://www.cs.ucsb.edu/~pconrad/cs56/examples/ldap/SimpleQuery/InstallCert.java ) which will allow my host and port to send the request. But when I was trying to run it on server it also showed some errors.

 ubuntu@ip-172-31-28-14:/var/lib/tomcat7/webapps$ java InstallCert 52.39.134.231:8080
 Loading KeyStore /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts...
 Opening connection to 52.39.134.231:8080...

Starting SSL handshake...

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
    at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:671)
    at sun.security.ssl.InputRecord.read(InputRecord.java:504)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:946)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
    at InstallCert.main(InstallCert.java:91)
 Could not obtain server certificate chain

And now I don't know what to do to send my request.

来源:https://stackoverflow.com/questions/37814861/issue-when-using-installcert-for-sslcertification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!