Can't find the location of file keystore when running as jar
See original GitHub issueI use Spring Boot 1.4.0. And I find that tomcat can’t read the keystore conatined in a jar. But how can I load the keystore in a jar.
The configuration about SSL:
server:
port: 8443
ssl:
enabled: true
key-store: classpath:keystore.jks
key-store-password: pass
key-alias: pass
#protocol: TSL
enabled-protocols: TLSv1,TLSv1.1,TLSv1.2
The Exception:
java.io.FileNotFoundException: class path resource [xx.jks] cannot be resolved to absolute file path because it does not reside in the file system:jar:file:/C:/xx/xx/xx/xx/xx/target/xx-1.0-SNAPSHOT.jar!/xx.jks
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
spring-boot executable war keystore not found - Stack Overflow
You should move keystore.jks out of your jar and update server.ssl.key-store with its location on the file system.
Read more >jarsigner
The jarsigner command uses key and certificate information from a keystore to generate digital signatures for JAR files. A keystore is a database...
Read more >How to use jarsigner to sign JARs files example | TechTarget
With the keys create and stored, export the server certificate to the filesystem so we can use it in the jarsigner's sign and...
Read more >EV Code Signing Certificates for Java - DigiCert.com
If after running the keytool or jarsigner command, the program pauses and does not prompt you for a password, unplug the device (token)...
Read more >Spring Cannot Find Key Store File - ADocLib
keytool exportcert rfc alias tomcat keystore keystore.jks file selfsigned.crt ... Ask questionsCan't find the location of file keystore when running as jar.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks. I fixed it by your samples.
My application files has :
and I can’t even change the code for
getResourceas I am importing some dependency …In my local it works fine, but deploying it to any external server (k8) I get this as URI is not hierarchical … and if i copy it o some location and provide the path … I get exception “System.out.println(“Could not find the truststore located at [” + config.getTruststore()+ “]”);”…
Any suggestions …