Enable SSL Secure Sockets Layer in Springboot Application using Authority Certificate provided by Lets Encrypt
-
Two files from Authority Certificate Provider like Lets Encrypt
-
publickey.pemcert1.pem
-
privatekey.pemprivkey1.pem
-
RUN
openssl pkcs12 -export -in publickey.pem -inkey privatekey.pem -name springboot -out springboot.p12 -
Provide
Enter Export PasswordandVerifying - Enter Export Password, this password will b used as the password key-store-password in application.yml in springboot project. -
As the result above command a file
springboot.p12will be created. -
Place file
springboot.p12atsrc/main/resources/.
server:
ssl:
enabled: true # enables https
key-store-type: pkcs12
key-store: classpath:springboot.p12
key-store-password: springboot [Optional]
key-alias: springboot
port: 8080