Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
198 views
in Technique[技术] by (71.8m points)

java - spring boot app unable to detect truststore

When I tried to start my spring boot app, I specified following 3 VM arguments:

-Djavax.net.ssl.trustStore=truststore.jks
-Djavax.net.ssl.trustStore.password=123456

I see the following 2 lines in the logs and my application failed to start with ssl error:

javax.net.ssl|DEBUG|17|restartedMain|2021-01-28 09:07:35.247 EST|TrustStoreManager.java:161|Inaccessible trust store: truststore.jks
javax.net.ssl|DEBUG|17|restartedMain|2021-01-28 09:07:35.248 EST|TrustStoreManager.java:112|trustStore is: C:Program FilesJavajdk-11.0.5libsecuritycacerts

I have put my trustore.jks file in src/main/resource folder but somehow spring boot is unable to access/detect it, also I am on a corporate machine and can't add the server certificates to cacerts so that solution won't work for me.

question from:https://stackoverflow.com/questions/65938877/spring-boot-app-unable-to-detect-truststore

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

for -Djavax.net.ssl.trustStore you need to set the full path to the store /path/to/truststore.jks and also you need to set the type of store like this

-Djavax.net.ssl.trustStoreType=jks

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...