springboot configuration https protocol

Ali cloud using a domain name, the domain name can be obtained on Ali cloud SSL book, springboot built tomcat, the tomcat download the appropriate certificate. Unpack two files one is the * .pfx and a * .txt file, txt file is password. In springboot configuration file need to use. The two documents are placed into the project resources directory with the same directory .properties, set the following three items application-dev.properties property profile:

server.ssl.key-store = classpath: 3108787_reco.lpcknew.com.pfx // put into the project .pfx file * 
server.ssl.key-Store-password = x5v83biE // this is to get to the * .txt password
server.ssl.keyStoreType = PKCS12 // key way
so successfully configured https protocol.
If the domain name is https://test.com; just assume that the domain name is mapped to the ip address, port project in the configuration file is server.port = 8087;
at the beginning of the access path is https://test.com:8087/

Note: Startup Items when you can see the words [https-nio-8087] and the like in the printing station

Guess you like

Origin www.cnblogs.com/lazyli/p/11897725.html