Created
July 28, 2022 15:04
-
-
Save dtelaroli/3f7b80800934896e0036023f94fd5156 to your computer and use it in GitHub Desktop.
How to fix SunCertPathBuilderException: unable to find valid certification path to requested target in MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# step 1 | |
# execute the command to get the certificates | |
openssl s_client -showcerts -connect start.spring.io:443 | |
# copy the lines stating in: Certificate chain (including this line) | |
# Ending in last -----END CERTIFICATE----- | |
# step 2 | |
# create the cert file with this content | |
mkdir $HOME/certs | |
touch $HOME/certs/root.crt | |
vim $HOME/certs/root.crt | |
# paste the cert content | |
# step 3 | |
# import the cert | |
$JAVA_HOME/bin/keytool -importcert -alias your-alias -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -file $HOME/certs/root.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment