Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Import ca.crt as a trusted certificate on RHEL 6.6

Martin O'Connor edited this page Apr 12, 2016 · 7 revisions

###Change to CA working directory

gocedar
cd CEDAR_CA/

###Locate the cacert file

Find out the currently active java version:

java -version

####Locate cacerts file

Locate the corresponding cacert file and pick the file that has the proper Java version in its path:

locate cacerts

or

sudo find / -type f -name cacerts

###Import root cert

sudo chmod a+w /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre/lib/security/cacerts
keytool -import -alias <HOSTNAME> -keystore /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre/lib/security/cacerts -file ./ca.crt

Replace <HOSTNAME> with the actual hostname. The requested password should be changeit.

###Useful, if mistakes were made

keytool -list -keystore /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre/lib/security/cacerts

keytool -delete -noprompt -alias alias  -keystore /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-0.b17.el6_7.x86_64/jre/lib/security/cacerts
Clone this wiki locally