Spring boot after https: The Tomcat connector configured to listen on port 8444 failed to start.

Viewed 37371

I followed a guide to enable https in Spring Boot. The application was beforehand working on https://localhost:8080

I've created a keystore.jks which is in the same directory as my application.properties, which now looks like:

# Define a custom port instead of the default 8080
server.port = 8444
# Tell Spring Security (if used) to require requests over HTTPS
security.require-ssl=true
# The format used for the keystore
server.ssl.key-store-type:PKCS12
# The path to the keystore containing the certificate
server.ssl.key-store=keystore.p12
# The password used to generate the certificate
server.ssl.key-store-password=<somepassword>
# The alias mapped to the certificate
server.ssl.key-alias=tomcat

Now, if I run the main method to start the spring boot app, it throws:

Description:

The Tomcat connector configured to listen on port 8444 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8444, or configure this application to listen on another port.

The port isn't in use, so it must be misconfiguration?

I'm unsure of what to change. It's a simple SPA app, Spring just serves an index.html and has a single REST endpoint. How should tomcat/spring be configured to accept https in this case, and start up without errors?

5 Answers

I solved the same issue by using the following configuration

# Define a custom port instead of the default 8080
server.port=8443
# Tell Spring Security (if used) to require requests over HTTPS
security.require-ssl=true
# The format used for the keystore 
server.ssl.key-store-type=PKCS12
# The path to the keystore containing the certificate
server.ssl.key-store=src/main/resources/keystore.p12
# The password used to generate the certificate
server.ssl.key-store-password=root0

I removed alias name and it worked perfectly. "You probably won't need a key alias, since there will only be one key entry" referred from TOMCAT SSL Error: Alias name does not identify a key entry

From Spring Boot 2.0 and higher, you can ignore this property.

security.require-ssl=true

To enable SSL, use the below configuration in your application.properties

The format used for the keystore

server.ssl.key-store-type=JKS

The path to the keystore containing the certificate

server.ssl.key-store=classpath:somecert.jks

The password used to generate the certificate

server.ssl.key-store-password=password

The alias mapped to the certificate

server.ssl.key-alias=alias_name

Note : server.ssl.key-store refers to the keystore location. Use classpath prefix, if it is present in src/main/resources. Otherwise use, file:/some/location.

I had the same issue as well but in my case the file path (in application.properties) for keystore file was incorrect on Linux and causing this error message.

I had same problem. for me server.ssl.key-alias was set to a wrong key. So, it sounds that some server mis-configurations in application.properties can cause this error message to appear.

Related