2) Make sure you have write access to your JRE and use the
keytool utility to import it:
keytool -import -alias alias -keystore
path-to-jre/lib/security/cacerts -file path-to-certificate-file
Example: keytool -import -alias sunas -keystore
/opt/jdk1.7/jre/lib/security/cacerts -file
/home/gugrim/tmp/msdgwebmgov.crt
3) You will be prompted for the keystore password, which is by
default changeit.
4) Also, when you connect to the server make sure you use the
same name as the one set as the Subject in the certificate. You may
need to add it to your host file if the server isn't reachable using
this name, which may be the case for a development/production server.
Note: No need to import certificate for java version 8 and above