茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1671854 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_00049.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2010/12/6 7:50:14

OpenSSL 簽發憑證方式

  • OpenSSL 版本 : openssl-0.9.8b-10.el5

1 根憑證 (Root CA) 作法:

1.1 建立根憑證 Private Key 檔 RootCA.key


openssl genrsa -des3 -out RootCA.key 2048
chmod og-rwx RootCA.key

看產生結果

1.2 產生根憑證的申請檔 RootCA.req

openssl req -new -key RootCA.key -out RootCA.req

看產生結果

1.3 產生效期十年的根憑證檔 RootCA.crt


openssl x509 -req -days 3650 -sha1 -extensions v3_ca -signkey RootCA.key -in RootCA.req -out RootCA.crt
rm -f RootCA.req

看產生結果

2 伺服器憑證 (Server CA) 作法:


2.1 建立伺服器憑證 Private Key 檔 ServerCA.key


openssl genrsa -out ServerCA.key 2048
chmod og-rwx ServerCA.key

看產生結果

2.2 產生伺服器憑證的申請檔 ServerCA.req

openssl req -new -key ServerCA.key -out ServerCA.req

看產生結果

2.3 產生效期兩年的伺服器憑證檔 ServerCA.crt


openssl x509 -req -days 730 -sha1 -extensions v3_req -CA RootCA.crt -CAkey RootCA.key  -CAserial RootCA.srl -CAcreateserial -in ServerCA.req -out ServerCA.crt
rm -f ServerCA.req

看產生結果


3 用戶憑證 (Client CA) 作法:

3.1 建立用戶憑證 Private Key 檔 ClientCA.key


openssl genrsa -des3 -out ClientCA.key 2048
chmod og-rwx ClientCA.key

看產生結果

3.2 產生用戶憑證的申請檔 ClientCA.req

openssl req -new -key ClientCA.key -out ClientCA.req

看產生結果

3.3 產生效期兩年的用戶憑證檔 ClientCA.crt


openssl x509 -req -days 730 -sha1 -extensions v3_req -CA RootCA.crt -CAkey RootCA.key  -CAserial RootCA.srl -CAcreateserial -in ClientCA.req -out ClientCA.crt
rm -f ClientCA.req

看產生結果

3.4 將 ClientCA.crt 與 ClientCA.key 轉成 ClientCA.pfx

openssl pkcs12 -export -in ClientCA.crt -inkey ClientCA.key -out ClientCA.pfx

看產生結果


  • 看到 apache 的 ssl_request_log 發現 IE7 使用 TLSv1 RC4-MD5, Firefox3 使用 SSLv3 DHE-RSA-AES256-SHA, cURL 7.15.5 使用 TLSv1 DHE-RSA-AES256-SHA



[root@pd920 httpd]# cat ssl_request_log
[20/Aug/2008:16:28:12 +0800] 192.168.11.248 TLSv1 RC4-MD5 "GET /t.txt HTTP/1.1" 25 <-- IE7
[20/Aug/2008:16:46:14 +0800] 192.168.11.248 SSLv3 DHE-RSA-AES256-SHA "GET /t.txt HTTP/1.1" 25 <-- Firefox3
[21/Aug/2008:12:18:55 +0800] 127.0.0.1 TLSv1 DHE-RSA-AES256-SHA "GET /t.txt HTTP/1.1" 5 <-- cURL 7.15.5
[root@pd920 httpd]#

參考網址


原文出處: OpenSSL 簽發憑證方式 [蔡宗融個人網站]
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|