跳到主要內容

如何把Windows的IIS網站的SSL憑證轉成Tomcat可以使用SSL憑證格式


如何把WindowsIIS網站的SSL憑證轉成Tomcat可以使用SSL憑證格式


1. IIS 匯出 SSL憑證交換檔,匯出格式為 .pfx

2. 使用 openssl 軟體將SSL憑證交換檔 .pfx檔換為 憑證及金鑰轉的文字檔
指令如下:
openssl pkcs12 -in myssl.pfx -out mysslkey.txt –nodes
myssl.pfx:由IIS匯出之金鑰憑證交換檔
mysslkey.txt:將myssl.pfx轉換成文字檔輸出之檔案

3. 使用文書編輯軟體打開mysslkey.txt即可檢視內容
裡面包含 SSL金鑰 和 SSL憑證
  
4. 使用文書編輯軟體新增一個ssl.txt
  並將憑證鏈及金鑰依序貼至ssl.txt
  TWCA為例,該公司的憑證鏈共四層,
     
   ssl.txt檔由上至下依序為:
  根憑證(UTN -DATACorp SGC (root.cer))
  中繼憑證(AddTrust External CA Root(uca_1.cer)TWCA Secure Certification
           Authority(uca_2.cer))
  伺服器憑證(server.cer)
  伺服器金鑰(於步驟3產生)

5. 使用openssl ssl.txt轉換為Tomcat金鑰檔
指令如下:
  openssl pkcs12 -export -in ssl.txt-out tomcat.p12 -name keyname

6. 使用Tomcatkeytool檢視Tomcat金鑰檔內容
 指令如下:
   keytool -v -list -keystore tomcat.p12 -storetype pkcs12

留言

這個網誌中的熱門文章

基隆望幽谷

基隆望幽谷, 就在八斗子 忘憂谷 , 穿過像宮崎駿風之谷般的山谷, 迎接而來的是藍海、山谷與島嶼, 走在山谷的步道上,你可以遠望基隆嶼與海洋。   https://www.pexels.com/zh-tw/photo/10093017/     https://www.pexels.com/zh-tw/photo/10093006/     https://www.pexels.com/zh-tw/photo/10092822/     https://www.pexels.com/zh-tw/photo/10093057/  
志良辭官 為官權勢利名之, 反覆風雲嘆不如, 媒體今昔竟大異。 是非曲直有誰知? 2010/03/10 09:07 2010/3/8衛生署署長楊 志良因健保費調漲費率與吳敦義不合而辭官

如何設定spring Boot的 SSL憑證

在安裝 spring Boot 的工作目錄裡 1. 上傳 .p12 格式的憑證到 spring Boot 的工作目錄裡的 keystore 目錄 2. 找到   application.properties 設定檔 加入底下設定 # Server Port server.port=443 # The format used for the keystore. It could be set to JKS in case it is a JKS file server.ssl.key-store-type=PKCS12 # The path to the keystore containing the certificate server.ssl.key-store=keystore/twcassl.p12 # The password used to generate the certificate server.ssl.key-store-password=[here is yourpassword] # The alias mapped to the certificate server.ssl.key-alias=twcassl 參考文件 1.      https://www.baeldung.com/spring-boot-https-self-signed-certificate 2.      https://docs.spring.io/spring-boot/docs/1.2.3.RELEASE/reference/html/howto-embedded-servlet-containers.html