配置tomcat支持HTTPS協議

一、建立證書 apache

keytool -genkey -alias tomcat -keyalg RSA -keysize 1024 -validity 365 -keystore tomcat.keystore

-alias 證書名稱瀏覽器

tomcat.keystore 建立的證書文件名tomcat

-validity 證書有效期,單位:天bash

 

二、修改server.xml文件code

<Connector port="80" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true"
    maxThreads="150" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS" 
    keystoreFile="conf/tomcat.keystore"
    keystorePass="123456"/>

keystorePass 證書的密碼server

 

三、瀏覽器導入證書xml

keytool -keystore D:\tomcat.keystore -export -alias tomcat -file D:\tomcat.cer

雙擊tomcat.cer安裝便可ssl

相關文章
相關標籤/搜索