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

前端 未结 6 785
逝去的感伤
逝去的感伤 2021-02-13 20:24

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

6条回答
  •  孤独总比滥情好
    2021-02-13 20:59

    I too had the same problem and was able to fix it. My problem was generating the keystore.p12 file.

    If you have a certificate file and private key file, you can generatekeystore.p12 file using following command.

    openssl pkcs12 -export -in  -inkey  -out keystore.p12 -name 
    

    You will be prompted for a password,there you can enter a password you like. Once the keystore file is generated copy it to the directory where your .jar file exist.

    Following is a working example configuration.

    server.port=8443
    security.require-ssl=true
    server.ssl.key-store-type=PKCS12
    server.ssl.key-store=file:keystore.p12
    server.ssl.key-store-password=
    server.ssl.key-alias=
    

    Note the key store file path file:keystore.p12 if it is going to reside in the same directory as the executable .jar file.

提交回复
热议问题