2013年9月8日 星期日

SSL 憑證安裝

一、設定中繼憑證
1. 設定中繼憑證,中繼憑證點兩下詳細資料→複製檔案→憑證匯出精靈


2. 憑證串聯由DER編碼格式轉換成PEM編碼格式,即Base64編碼格式
    切換至<<apache目錄位置>>/bin/>  openssl pkcs7 -in  "eCA_Public CA.p7b" -inform DER -print_certs -out      "eCA_Public CA.pem"

3.憑證串連檔案複製為SSLCertificateChainFile
   copy eCA_Public CA.pem ca.crt

二、安裝SSL伺服器憑證
1. 將給的憑證由改名為server.cer,接著執行下面動作,但是由於在Windwos Apache會導致錯誤訊息產生,所以改為跟上面第一步驟一樣的方法轉換成PEM編碼格式
rver.p7b" -inform DER -print_certs -out "server.pem"

 切換至<<apache目錄位置>>/bin/>  openssl x509 -in  "server.cer" -inform DER  -out "server.pem"

2. 憑證串聯檔案複製為SSLCertificateFile
    copy server.pem server.crt

三、設定檔變更
最主要要設定httpd-ssl.conf,1和2要match,ca為PublicCA_64.crt 中繼憑證。
1. SSLCertificateFile "<<apache目錄位置>>/conf/server.crt"

2.SSLCertificateKeyFile "<<apache目錄位置>>/conf/server.key"

3.SSLCertificateChainFile "<<apache目錄位置>>/conf/ca.crt"

最後直接開網頁測試https是否成功。

四、問題
[error] Unable to configure RSA server private key
[error] SSL Library Error: 185073780 error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

首先檢查公開金鑰私密金鑰是否匹配,命令提示字元檢查方式:
openssl x509 -noout -text -in certfile
openssl rsa -noout -text -in keyfile

沒有留言:

張貼留言