Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Connect to SSL Server Failed with Invalid Certificate
Why am I getting the ValidatorException error when connecting to an SSL server?
✍: FYIcenter
You are getting a ValidatorException error when connecting to an SSL server,
because the server certificate can not be trusted for one of the following possible reasons:
You can play with SslServerCmd.java and SslClientCmd.java given in previous tutorials to see the ValidatorException error:
1. Open a command window and run SslServerCmd.java on your local host:
\fyicenter>\local\jdk-1.8.0\bin\java SslServerCmd USAGE: java SslServerCmd [port [clientAuth]] Listening: port=8080, clientAuth=No
2. Open another command window and run SslClientCmd.java on your local host:
\fyicenter>\local\jdk-1.8.0\bin\java SslServerCmd Exception in thread "main" 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:1937) ...
In this case, the server certificate is signed by yourself as the root CA. The client program SslServerCmd.java cannot trust it, because the root CA in not listed in the default trusted root CA list.
Owner: CN=fyicenter.com, OU=IT, O=FYIcenter, L=NA, ST=NA, C=FR Issuer: CN=fyicenter.com, OU=IT, O=FYIcenter, L=NA, ST=NA, C=FR
⇒ Make SSL Server Certificate Trusted
⇐ SslServerCmd.java - SSL Server Command Example
2018-06-27, ∼1909🔥, 0💬
Popular Posts:
JDOM provides a solution for using XML from Java that is as simple as Java itself. There is no compe...
ANTLR is a powerful parser generator for multiple programming languages including Java. ANTLR contai...
JDK 17 java.naming.jmod is the JMOD file for JDK 17 Naming module. JDK 17 Naming module compiled cla...
The JSR 105 XML Digital Signature 1.0.1 FCS implementation provides an API and implementation that a...
JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module. JDK 17 Desktop module compiled ...