tomcat - spring-boot executable war keystore not found -
i build spring-boot executable war ssl support. application.properties file is:
server.port = 8443 server.ssl.key-store = classpath:keystore.jks server.ssl.key-store-password = secret server.ssl.key-password = another-secret
war file contains 'keystore.jks' file. strange exception:
org.springframework.context.applicationcontextexception: unable start embedded container; nested exception org.springframework.boot.context.embedded.embeddedservletcontainerexception: not find key store classpath:keystore.jks
caused by: java.io.filenotfoundexception: class path resource [keystore.jks] cannot resolved absolute file path because not reside in file system: jar:file:/d:/projects/vi3na/vi3na.web/target/vi3na.war!/web-inf/classes!/keystore.jks
what sign '!' mean in path 'd:/projects/vi3na/vi3na.web/target/vi3na.war!/web-inf/classes!/keystore.jks'
update: result of this enhancement request, limitation described below no longer applies. tomcat 8.0.28+ , 7.0.66+ can load key store within jar file.
original answer
i guess you're using tomcat embedded servlet container? noted in reference documentation, tomcat not support loading keystore or trust store within jar:
tomcat requires key store (and trust store if you’re using one) directly accessible on filesystem, i.e. cannot read within jar file.
you should move keystore.jks
out of jar , update server.ssl.key-store
location on file system.
Comments
Post a Comment