Skip to content

Unlike Jetty and Tomcat, Reactor Netty and Undertow do not cause a startup failure when SSL is enabled but no key store is configured #15491

@nnanda2016

Description

@nnanda2016

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by anothertype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions