您的位置:首页 > 理论基础 > 计算机网络

configuration of tomcat: switch from http protocol to https protocol

2016-09-29 11:31 295 查看
Only for configurations of tomcat without explanations of the SSL or TLS. https is much more safer than that of http, also get a pitfall, convinence  concern and speed. As apple announced that all http protocols will be prohibited untill 1/1/2017. So it
is in high essentiality to switch from previous http to https.

Before starting processing our configuration, i have to point out this is only for unix/linux tomcat, not for windows. 

Step1: Firstly, inter into the /bin fold under your pc's java installation path. as show the pic following:



in the bin fold, excute the keytool by typing keytool -genkey -alias yourcomstomisedname -keyalg RSA -keystore your/customised/path

Step2: Follwing this, there will be prompts to ask you filling password or something personally. after finishing these steps, a certificate will be created and saved under the fold your/customised/path. 

Then, go the the configuration file of your server and open it, called server.xml. under the conf fold of your server. just like below:



Step3: Finally, indicate the server.xml to the "Define a SSL HTTP/1.1 Connector
on port 8443", and open the annotation , add the absolute path of the certificate to the part as shown below:



please replace the keystoreFile to your local own certificate's path, and the keystorePass to your own password what you set before. then save the file server.xml and restart
your tomcat. your https link will be function well. 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  https tomcat