VM桌面虛擬化--連接服務器自簽名證書替換

 

                   連接服務器替換自簽名證書openssl

 

每章一段話:

藉口太多的人,成功與他無緣,最後註定就剩下嘆息,後悔終老,任何事情,怕!就會輸一輩子。

 

一、於 Windows Server 2008 AD 服務器內安裝下列角色
1. IIS,需「含 IIS 客戶端憑證對應驗證」與「客戶端憑證對應驗證」。
2. Active Directory 憑證服務。需勾選「證書頒發機構單位」與「證書頒發機構單位網頁註冊」。


二、安裝 openssl

1. Win64 OpenSSL v1.0.1c
2. Visual C++ 2008 Redistributables (x64)

第二個軟件一般2008自帶安裝

 

三、操作 openssl
1.開啓 cmd 並跳到 C:\OpenSSL-Win64\bin 目錄下。
2.下 SET OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg 指令。
3.產生 key 與 csr 檔如下所示:


C:\OpenSSL-Win64\bin>openssl req -newkey rsa:2048 -keyout View-CS.key -nodes -days 3650 -out View-CS.csr
Loading ‘screen’ into random state – done
Generating a 2048 bit RSA private key …………………+++ …………………………..+++
writing new private key to ‘View-CS.key’
—–
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]:NTUEEES
Organizational Unit Name (eg, section) []:Admin
Common Name (e.g. server FQDN or YOUR name) []:view.itrg.com(!!連接服務器的FQDN)
Email Address []:[email protected]

Please enter the following ‘extra’ attributes to be sent with your certificate request
A challenge password []:
An optional company name []:


4. 開啓剛纔產生的 View-CS.csr 並將內容 copy 到 AD 服務器上的 Active Directory 憑證服務網頁,例如 http://ca.itrg.com/certsrv/
5. 按「申請證書」->「高級證書」->「用 Base-64 編碼的 CMC 或 PKCS #10 檔案來提交憑證要求,或用 Base-64 編碼的 PKCS #7 檔案提交
更新要求」 。
6. 開啓剛纔產生的 certificate.csr 並將內容 copy 到 Base-64 編碼的憑證字段裏,證書模板選「web服務器」。
7. 將憑證以 Base64 編碼方式下載憑證並存到 C:\OpenSSL-Win64\bin,檔名通常叫 certnew.cer
8. 於 cmd 下以下 openssl pkcs12 -export -in certnew.cer -inkey View-CS.key – name vdm -passout pass:yourpassword -out View-CS.pfx


四、匯入憑證
1.於 cmd 下 mmc.exe
2. 「文件」->「新增或移除管理單元」->「證書」,選「計算機帳戶」如下圖。其他默認

image

3. 於 mmc 左側控制檯根目錄點選「證書(本地計算機)」->「個人」。
4. 於右側按 mouse 右鍵選「所有任務」->「導入」,選擇剛纔產生的.pfx 檔案。

image

5. 打入剛纔 keyin 的密碼並勾選「標註此祕鑰爲可導出的祕鑰」並按下一步。

image
6. 點選「將所有證書放入下列存儲」,證書存儲選擇「個人」,按下一步完成。

注意!!如果這個證書的顯示信息爲“這個跟CA不受信任”那麼做如下操作

         登錄到證書申請頁面,例如:http://ca.itrg.com/certsrv/
image 下載CA證書或證書鏈,並把CA證書導入到受信任的根證書頒發機構裏。【右鍵安裝證書】->【將所有證書放入下列存儲】->【預覽】->【受信任的根證書頒發機構】完成

image


7. 重啓 connection server
8. 登入 VMware View Administrator 檢查 Dashboard 下的 Connection Servers 是否變成綠燈。如下圖。

image

注意!!這個時候就完成了證書的替換,要注意這個時候客戶端用ssl加密登錄的時候輸入的是連接服務器的FQDN(完全合格域名)。注意DNS解析。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章