精心為您準備的Openssl實現私人CA的詳細過程,以及如何配置安裝認證

來源:互聯網
上載者:User

 給自己一個自簽認證一般需要一個用戶端和一個伺服器端,為了方便起見,我所做的自簽認證是在同一台主機上完成的,然後在物理主機上安裝驗證。

一、實現私人CA的準備過程1、 安裝ssl模組

650) this.width=650;" border="0" alt="" src="http://img1.51cto.com/attachment/201304/222636329.png" />

2、 查看mod_ssl列表

650) this.width=650;" border="0" alt="" src="http://img1.51cto.com/attachment/201304/222654930.png" />

二、做一個自簽認證的詳細的過程1、先為自簽認證產生一個密鑰

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912513949-2.png" />

2、vim /etc/pki/tls/openssl.cnf 修改以下內容

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912513049-3.png" /> 

3、在此產生一個自簽認證

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912516428-4.png" />

4、vim /etc/pki/tls/openssl.cnf 修改CA的中心目錄

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/19125142V-5.png" />

5、再查看一下就可發現認證產生成功了

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912512B6-6.png" />

6、再建立幾個目錄和檔案為以下過程做好充足準備

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912516100-7.png" />

7、建立一個目錄,然後把產生的一對密鑰儲存至httpd.key650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912515964-8.png" />8、產生憑證發行請求

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/191251FD-9.png" />

9、此時就可簽署認證了

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912513M0-10.png" />

10、來看看認證是否簽署成功

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912512453-11.png" />

11、這時候你就會發現認證發成功了,激動吧

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912511P9-12.png" />

此時伺服器上就有認證了,設定管理員可以使用此認證,怎麼配置呢?三、如何配置認證1、備份目錄

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/19125135T-13.png" />

2、vim ssl.conf   修改如下內容

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/191251L15-14.png" />

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912513X1-15.png" />

3、檢查是否有文法錯並重啟系統

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/191251CD-16.png" />

4、查看443連接埠是否被監聽

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912512158-17.png" />

5、vim /etc/hosts 解析檔案

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912515596-18.png" />

6、訪問www.hello.com

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/19125151W-19.png" />

7、訪問https://www.hello.net

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912516022-20.png" />

8、無權訪問怎麼辦?我們要把用戶端的認證發給伺服器端一份cdcd /etc/pki/CA 先切換到此目錄下

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/19125144Q-21.png" />

9、cacert.pem傳送到物理主機後,要為其重新命名

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912511593-22.png" /> 

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912513c3-23.png" />

四、把認證匯入瀏覽器並驗證的過程1、開始安裝認證

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/191251B28-24.png" />

2、單擊“下一步”

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912516161-25.png" />

3、選擇認證存放的位置

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912514333-26.png" />

4、認證匯入完成

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912512116-27.png" />

5、選擇“是”單擊

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912515062-28.png" />

6、認證匯入成功

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912516017-29.png" />

7、管理憑證

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/1912515637-30.png" />

8、查看匯入的認證

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/191251C13-31.png" />

9、訪問網頁時發現加密成功

650) this.width=650;" border="0" alt="" src="http://www.bkjia.com/uploads/allimg/131227/19125151I-32.png" />

這樣我們對整個網站的訪問都是加密的,配置ssl網站是不是很簡單呢?以上就是實現私人CA的配置和安裝過程,希望能給您提供一些小小的學習上的協助。

本文出自 “show_only” 部落格,請務必保留此出處http://10240214.blog.51cto.com/6634068/1175705

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.