Make SSL Server Certificate Trusted
How to make a SSL self-signed server certificate trusted? I want the ValidatorException going away.
There are several options to make a self-signed server certificate trusted:
Below is a demonstration of the last option:
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. Save the server certificate in a keystore file for the client program to use:
\fyicenter>\local\jdk-1.8.0\bin\keytool -importcert -file server.crt -alias server -keystore server_crt.jks Enter keystore password: fyicenter Re-enter new password: fyicenter 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 Serial number: 5ae4a887 Valid from: Sun Jun 25 08:00:08 until: Sat Sep 23 08:00:08 ... Trust this certificate? [no]: yes Certificate was added to keystore
3. Open another command window and run SslClientCmd.java with javax.net.ssl.trustStore system property set to server_crt.jks on your local host:
\fyicenter>\local\jdk-1.8.0\bin\java -Djavax.net.ssl.trustStore=server_crt.jks SslClientCmd localhost 8080 /index.html HTTP/1.0 200 OK Content-Type: text/html Content-Length: 40
No more SSL errors. The client program successfully communicated with the server with all messages encrypted.
2018-06-27, 792👍, 0💬
Crimson is a Java XML parser which supports XML 1.0 via the following APIs: JAXP 1.1, SAX 2.0, DOM L...
c3p0 is an easy-to-use library for making traditional JDBC drivers "enterprise-ready" by augmenting ...
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime e...
The SOAP with Attachments API for JavaTM (SAAJ) 1.3 provides the API for creating and sending SOAP m...
Guava is a suite of core and expanded libraries that include utility classes, google's collections, ...