Hi everyone

This is a report of a breaking change from Spring Boot 3.3.6 -> 3.4.0 and if it is correct and intended.

Spring Boot 3.3.6

spring:
  ssl:
    bundle:
      jks:
        server:
          keystore:
            location: "D:/repositories/bugreport-ssl-location/keyStore.p12"

Spring Boot 3.4.0

spring:
  ssl:
    bundle:
      jks:
        server:
          keystore:
            location: "file:D:/repositories/bugreport-ssl-location/keyStore.p12"

Upgrading from Spring Boot 3.3.6 to 3.4.0 without changing keystore location results in following error:

 :: Spring Boot ::                (v3.4.0)

2024-12-10T10:59:23.118+01:00  INFO 17584 --- [bugreport-ssl-location] [           main] c.m.b.BugreportSslLocationApplication    : Starting BugreportSslLocationApplication using Java 21.0.1 with ....
2024-12-10T10:59:23.120+01:00  INFO 17584 --- [bugreport-ssl-location] [           main] c.m.b.BugreportSslLocationApplication    : No active profile set, falling back to 1 default profile: "default"
2024-12-10T10:59:23.764+01:00  WARN 17584 --- [bugreport-ssl-location] [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server
2024-12-10T10:59:23.768+01:00  INFO 17584 --- [bugreport-ssl-location] [           main] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-12-10T10:59:23.783+01:00 ERROR 17584 --- [bugreport-ssl-location] [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:165) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:621) ~[spring-context-6.2.0.jar:6.2.0]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:318) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1361) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1350) ~[spring-boot-3.4.0.jar:3.4.0]
    at com.michibaum.bugreport_ssl_location.BugreportSslLocationApplication.main(BugreportSslLocationApplication.java:10) ~[classes/:na]
Caused by: java.lang.IllegalStateException: Could not load store: Unable to create key store: Could not load store from 'D:/repositories/bugreport-ssl-location/keyStore.p12'
    at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSslStores(SslConnectorCustomizer.java:145) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.applySslBundle(SslConnectorCustomizer.java:119) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.addSslHostConfig(SslConnectorCustomizer.java:95) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSsl(SslConnectorCustomizer.java:86) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.customize(SslConnectorCustomizer.java:71) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.customizeSsl(TomcatServletWebServerFactory.java:383) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.customizeConnector(TomcatServletWebServerFactory.java:359) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:212) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:188) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-3.4.0.jar:3.4.0]
    ... 8 common frames omitted
Caused by: java.lang.IllegalStateException: Unable to create key store: Could not load store from 'D:/repositories/bugreport-ssl-location/keyStore.p12'
    at org.springframework.boot.ssl.jks.JksSslStoreBundle.createKeyStore(JksSslStoreBundle.java:112) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.ssl.jks.JksSslStoreBundle.lambda$new$0(JksSslStoreBundle.java:75) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.util.function.SingletonSupplier.get(SingletonSupplier.java:106) ~[spring-core-6.2.0.jar:6.2.0]
    at org.springframework.boot.ssl.jks.JksSslStoreBundle.getKeyStore(JksSslStoreBundle.java:81) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSslStores(SslConnectorCustomizer.java:137) ~[spring-boot-3.4.0.jar:3.4.0]
    ... 17 common frames omitted
Caused by: java.lang.IllegalStateException: Could not load store from 'D:/repositories/bugreport-ssl-location/keyStore.p12'
    at org.springframework.boot.ssl.jks.JksSslStoreBundle.loadKeyStore(JksSslStoreBundle.java:140) ~[spring-boot-3.4.0.jar:3.4.0]
    at org.springframework.boot.ssl.jks.JksSslStoreBundle.createKeyStore(JksSslStoreBundle.java:107) ~[spring-boot-3.4.0.jar:3.4.0]
    ... 21 common frames omitted
Caused by: java.io.FileNotFoundException: class path resource [D:/repositories/bugreport-ssl-location/keyStore.p12] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:215) ~[spring-core-6.2.0.jar:6.2.0]
    at org.springframework.boot.ssl.jks.JksSslStoreBundle.loadKeyStore(JksSslStoreBundle.java:135) ~[spring-boot-3.4.0.jar:3.4.0]
    ... 22 common frames omitted


Process finished with exit code 1

Additional

Probable change to this occurrence: https://github.com/spring-projects/spring-boot/issues/42835 Example Project: https://github.com/MichiBaum/bugreport-ssl-location Issue Opened in Spring Cloud (Sorry): https://github.com/spring-cloud/spring-cloud-gateway/issues/3631

Comment From: mhalbritter

Duplicate of https://github.com/spring-projects/spring-boot/issues/43274.