如何把Windows的IIS網站的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. 使用Tomcat的keytool檢視Tomcat金鑰檔內容
指令如下:
keytool -v -list -keystore tomcat.p12 -storetype pkcs12
留言