Tomcat中https協議的部署

2021-04-30 15:17:08 字數 1092 閱讀 9537

隨著網路的日益流行,在給我們帶來上網便利的同時,也給一些惡意分子提供了傳播平台,以至現在的病毒是層出不全,因此各個網上銀行系統也採用了相應的防禦措施,如最普遍的就是採用https協議,而不用http協議來進行傳輸,提供資料傳輸的安全性了,並採用了相關的數字簽名或硬體如工行的u盾等相關手段來提高安全性了,現在說明下我比較常用的tomcat服務上https協議是如何部署的:

1、用-genkey命令選項,產生公私金鑰對

命令為:

keytool -genkey -alias tomcat -keyalg rsa -keystore d:/test/keystore -keysize 1024 -sigalg md5withrsa

2、產生自簽證書,輸入以下命令

keytool -selfcert -alias tomcat -dname "cn=hhm, ou=newland, o=newland, l=fz,st=fj, c=cn" -keystore d:/test/keystore

3、匯出自簽證書

keytool -export -rfc -alias tomcat -keystore d:/test/keystore -file mycert.crt

4、tomcat中的server.xml的配置

增加如下配置:

5、訪問路徑的更改

注:自簽的證書mycert.crt中選項rfc是把證書輸出為rfc1421定義的、用base64最終編碼的格式的

tomcat 配置https協議

2.使用jdk keytool 生成keystore 3.到處相應的cer證書檔案 4.修改 conf server.xml 5.瀏覽器匯入證書 使用命令 keytool genkeypair alias tomcat keyalg rsa keystore e tomcat.keystore 使用...

tomcat開啟https協議

1.在tomcat的conf server.xml 中配置 2.將 redirectport 的埠號都指向443 3.在conf web.xml裡最下面配置 security constraint web resource collection web resource name ssl web r...

配置Tomcat使用https協議

這裡測試使用的環境 jdk 1.7 tomcat 8 這裡使用jdk自帶的keytool工具來生成證書 1.在jdk的安裝目錄 bin keytool.exe下開啟keytool.exe 在cmd中進入到該檔案目錄 2.在命令列中輸入以下命令 keytool genkeypair alias tom...