於 Windows 2003 Server。
建議先安裝 Microsoft Visual C++ 2008 Redistributable Package。
http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-
074B9F2BC1BF&displayLang=zh-tw
下載並安裝 vcredist_x86.exe。

http://www.slproweb.com/products/Win32OpenSSL.html
下載並安裝 Win32OpenSSL-1_0_0d.exe。

建立憑證中心的私有金鑰
cd C:\OpenSSL-Win32\bin → openssl genrsa -des3 -out CA.flyfox.twbbs.org.key 2048 →
Enter pass phrase for CA.flyfox.twbbs.org.key: abc123 →
Verifying - Enter pass phrase for CA.flyfox.twbbs.org.key: abc123 →
產生 C:\OpenSSL-Win32\bin\CA.flyfox.twbbs.org.key

移除憑證的密碼 (remove the SSL pass phrase),一般伺服器的服務若使用到 SSL 憑證加密,
在啟動服務時都會要求憑證的密碼,有時會感到不方便,可以參考以下方式移除憑證的密碼。

移除 RSA 編碼憑證
openssl rsa -in abc.flyfox.twbbs.org.key -out flyfox.twbbs.org.key →
abc123
移除 DSA 編碼憑證
openssl dsa -in abc.flyfox.twbbs.org.key -out flyfox.twbbs.org.key →
abc123

建立憑證中心的簽證檔
openssl req -new -key flyfox.twbbs.org.key -x509 -days 3650 -out flyfox.twbbs.org.crt
Enter pass phrase for flyfox.twbbs.org.key:
Loading 'screen' into random state - done
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:TW
State or Province Name (full name) [Some-State]:Taiwan
Locality Name (eg, city) []:Taipei
Organization Name (eg, company) [Internet Widgits Pty Ltd]:twbbs
Organizational Unit Name (eg, section) []:CA
Common Name (eg, YOUR name) []:flyfox
Email Address []:flyfox@flyfox.twbbs.org

使用 apache2.2_mod_ssl 若出現 Unable to load config info from /usr/local/ssl/openssl.cnf,
可用以下方式來解決:
openssl req -config "C:\Program Files\Apache Software Foundation\Apache2.2\conf\openssl.cnf"
-new -key flyfox.twbbs.org.key -x509 -out flyfox.twbbs.org.crt


IIS 管理介面,網站 → 預設的網站 → 右鍵 → 內容 → 目錄安全設定 → 伺服器憑證 →
建立新憑證 → 準備要求,但稍後再傳送 → 輸入憑證名稱及設定位元長度 →
輸入公司名稱及單位名稱 → 輸入認證 DNS 名稱(非常重要,如:flyfox.twbbs.org) →
輸入地理資訊 → 憑證要求檔案名稱 → 完成。

將 C:\certreq.txt 更名為 flyfox.twbbs.org.txt,
openssl x509 -req -days 365 -in flyfox.twbbs.org.txt -CA CA.flyfox.twbbs.org.crt -CAkey
CA.flyfox.twbbs.org.key -CAcreateserial -out flyfox.twbbs.org.crt
Loading 'screen' into random state - done
Signature ok
subject=/C=TW/ST=Taiwan/L=Taipei/O=flyfox/OU=ssl/CN=\x00a\x00c\x00d\x00_\x00r\x00d\
x004\x00_\x002\x000\x000\x003
Getting CA Private Key
Enter pass phrase for CA.flyfox.twbbs.org.key:abc123

產生 C:\OpenSSL-Win32\bin\flyfox.twbbs.org.crt、CA.srl

IIS 管理介面 → 網站 → 預設的網站 → 右鍵 → 內容 → 目錄安全設定 →
伺服器憑證 → 處理擱置要求及安裝憑證 → 選取 flyfox.twbbs.org.crt 憑證 → 完成。

arrow
arrow
    全站熱搜

    flyfox 發表在 痞客邦 留言(0) 人氣()