Reputation: 720
I know this question has been asked multiple times but I still can't seem to get around it. I'm trying to connect to Azure-SQL
db from my SpringBoot app and keep running into this error :
Caused by: java.io.IOException: Keystore was tampered with, or password was incorrect
at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:783) ~[na:1.8.0_251]
Caused by: java.security.UnrecoverableKeyException: Password verification failed
I've a rapidssl.jks file that I'm adding to the app's VM args to get past something similar to "PKIX path building failed" and "unable to find valid certification path to requested target"
I'm on MacBook
and have tried to create a self signed certificate using:
sudo keytool -export -keystore rapidssl-36.1.2.jks -file selfsign.crt
and importing it using: sudo keytool -import -keystore "cacerts" -file "/Users/Documents/cert/selfsign.crt" -alias rapidssl
running in /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/security
directory. I completed those steps but still can't get past the error. Any suggestions/recommendations?
I'm on Java 8 (zulu jdk), SpringBoot: 2.0.4-RELEASE, MacBook OS Catalina 10.15.7
Upvotes: 2
Views: 26267
Reputation: 11
Add all of the below properties:
Upvotes: 1
Reputation: 11860
The quotes in your command seem to be the issue:
sudo keytool -import -keystore "cacerts" -file "/.../selfsign.crt" ...
The keystore cacerts
, as well as the file
shouldn't be in between quotes.
You already execute it on the right path (jre/lib/security), so try this:
sudo keytool -import -keystore cacerts -file /.../selfsign.crt -alias rapidssl
An example of the keytool command:
Upvotes: 1