Import self-signed SSL certificate in Javamonday, february 09, 2015
While developing web services you might get into the situation where an SSL certificate is needed.
Java does not allow self-signed certificates per default which results in an
SSLHandshakeException. To overcome this
you could globally accept all certificates. But sometimes it’s a better solution to install the temporary development
certificate into Java’s keystore.
Therefore you add the desired certificate via
cd <JDK_HOME>/jre/lib/security keytool -import -keystore cacerts -file cert.crt
The default password for the Java keystore is
Found the post useful? Subscribe to my newsletter for more free content, tips and tricks on IT & Java:
All opinions are my own and do not reflect those of my employer or colleagues.