Skip to content

Breaking change ssl keystore location intended #43461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MichiBaum opened this issue Dec 10, 2024 · 1 comment
Closed

Breaking change ssl keystore location intended #43461

MichiBaum opened this issue Dec 10, 2024 · 1 comment
Labels
status: duplicate A duplicate of another issue

Comments

@MichiBaum
Copy link

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: #42835
Example Project: https://github.com/MichiBaum/bugreport-ssl-location
Issue Opened in Spring Cloud (Sorry): spring-cloud/spring-cloud-gateway#3631

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 10, 2024
@mhalbritter
Copy link
Contributor

Duplicate of #43274.

@mhalbritter mhalbritter closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
@mhalbritter mhalbritter added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants