First use the command line to generate a keystore file:
keytool -genkey -alias tomcat -keyalg RSA -keystore ./jerry.keystore
Save to local project folder:
The application.properties file in Springboot is maintained as follows:
server.port=5031
server.ssl.key-store=jerry.keystore
server.ssl.key-alias=tomcat
server.ssl.enabled=true
server.ssl.key-store-password=123456
server.ssl.key-store-type=JKS
The HTTPS protocol takes effect:
You can see that the certificate used is indeed the one I just created from the command line:
For more of Jerry’s original articles, please follow the public account “Wang Zixi “: