Monday 20 February 2017

Import ssl certificate to Java Key Store::

Import SSL certificates to Java Key Store::
=================================
Download the certificate to the home directory of the domain and run the keytool utility to import the certificate to Java Key Store


===========

Command to convert .pfx certificate to .crt

#  openssl pkcs12 -in ind-vmn-vm3.win12vmn.test.int.pfx -clcerts -nokeys -out ind-vmn-vm3.win12vmn.test.int.crt

The self-signed certificate generated in windows is in  .pfx format.
===========


# keytool --import --file certificate.cer --keystore  name


# keytool -import -trustcacerts -alias testaliasname -file ind-vmn-vm3.win12vmn.test.int.crt -keystore /opt/java/jdk1.8.0_121/jre/lib/security/cacerts

To list the installed certificate:
# keytool -list -v -keystore /opt/java/jdk1.8.0_121/jre/lib/security/cacerts  | grep Alias | grep gigtest

It will be stored in /opt/username/jdk1.8.0_121/jre/lib/security/cacerts

Backup cacerts before running the java keytool.

No comments:

Post a Comment