-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Description
Spring Boot Version: 2.0.5
Case-1
If I set server.ssl.enabled=true
, but do not provide SSL key-store details (via corresponding properties), what should be the behavior? I mean does server start in SSL mode. I am experiencing a behavior where my app starts without any warning/error, but the requests (over HTTP) fail with Empty reply from server
.
Case-2
If I set server.ssl.enabled=true
and server.ssl.key-store=classpath:ks_does_not_exist.p12
, the app does not start, but I see following log line:
2018-12-18 21:50:01.370 [Thread: main] [WARN] TxPath: org.springframework.boot.web.reactive.context.AnnotationConfigReactiveWebServerApplicationContext# Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is java.lang.IllegalStateException: java.io.FileNotFoundException: class path resource [ks_does_not_exist.p12] cannot be resolved to URL because it does not exist
Case-3
If I set server.ssl.enabled=true
and server.ssl.key-store=classpath:valid_ks.p12
, server.ssl.key-store-password=wrong_password
, the app fails to start with following log line
2018-12-18 21:53:50.276 [Thread: main] [ERROR] TxPath: org.springframework.boot.SpringApplication# Application run failed
org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is java.lang.IllegalStateException: java.io.IOException: keystore password was incorrect
Expected behavior
Case-1: Spring Boot should fail to start with error saying SSL is enabled, but corresponding key-store details are missing.
Case-2: Spring Boot should write the log at ERROR
level with stack trace. The WARN
level is inconsistent with Case-3
.
Case-3: This is the right behavior.