Skip to content

Instantly share code, notes, and snippets.

@perryism
Created June 14, 2023 22:40
Show Gist options
  • Save perryism/c2638cbb67a986a118bf4135169affc0 to your computer and use it in GitHub Desktop.
Save perryism/c2638cbb67a986a118bf4135169affc0 to your computer and use it in GitHub Desktop.
Import certs from a folder to a java runtime
JAVA_HOME=$(java_home -v 18)
CERT_FOLDER=/Users/plee/.certs
KEYSTORE=$JAVA_HOME/lib/security/cacerts
for cert in $(ls $CERT_FOLDER)
do
sudo keytool -import -alias $(basename $cert .cer) -keystore $KEYSTORE -file $CERT_FOLDER/$cert
done
#sudo keytool -list -keystore $KEYSTORE | grep -i <cert name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment