#!/bin/bash curl http://www.cacert.org/certs/root.crt -o ~/cacert_class1.crt curl http://www.cacert.org/certs/class3.crt -o ~/cacert_class3.crt KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts echo "yes " | keytool -keystore $KEYSTORE -storepass changeit -import -trustcacerts -v -alias cacertclass1 -file ~/cacert_class1.crt keytool -keystore $KEYSTORE -storepass changeit -import -trustcacerts -v -alias cacertclass3 -file ~/cacert_class3.crt rm ~/cacert_class1.crt ~/cacert_class3.crt
KEYSTORE
keystore
/Library/Java/Home/lib/security/cacerts