https伺服器的配置(三)建立私人CA和認證

來源:互聯網
上載者:User

標籤:ca   認證   

首先在其他主機上建立一個私人的CA


假如我我現在就另外開一台虛擬機器


登入進去

一、生存一對密鑰(私密金鑰和公開金鑰,公開金鑰可以在私密金鑰中提取因此建立私密金鑰就可以了)

[[email protected] ~]#cd/etc/pki/CA

[[email protected] CA]#(umask 077; opensslgenrsa –out private/cakey.pem 2048)

 

二、產生CA的認證


[[email protected] CA]# openssl req -new -x509-key private/cakey.pem -out cacert.pem

 

You are about to be asked to enterinformation that will be incorporated

into your certificate request.

What you are about to enter is what iscalled a Distinguished Name or a DN.

There are quite a few fields but you canleave some blank

For some fields there will be a defaultvalue,

If you enter ‘.‘, the field will be leftblank.

-----

Country Name (2 letter code) [XX]:CN

State or Province Name (full name) []:Henan

Locality Name (eg, city) [DefaultCity]:Zhengzhou

Organization Name (eg, company) [DefaultCompany Ltd]:HuangBY

Organizational Unit Name (eg, section)[]:Tech

Common Name (eg, your name or your server‘shostname) []:www.huangbaoying.com

Email Address []:[email protected]

 

Please enter the following ‘extra‘attributes

to be sent with your certificate request

A challenge password []:

An optional company name []:

[[email protected] CA]# mkdir certs newcerts crl

[[email protected] CA]# touch index.txt

[[email protected] CA]# touch serial

[[email protected] CA]# echo 01 > serial

OK準備給人家簽證吧

 

三、好了,現在在httpd伺服器的主機上

[[email protected] ~]# cd /etc/httpd/

[[email protected] httpd]# mkdir ssl

[[email protected] httpd]#cd ssl

建立私密金鑰

[[email protected] ssl]# (umask 077; opensslgenrsa –out httpd.key 1024)

建立認證

[[email protected] CA]# openssl req –new -key httpd.key-out httpd.csr

 

把認證發給CA

 

現在我們切換到CA如果你在同一台主機上就不再切換了

四、簽證

[[email protected] ~]#openssl ca –in httpd.csr –outhttpd.crt –days 3650

好了簽證完畢把httpd.crt發給httpd的伺服器主機

 

五、登入到httpd的伺服器主機

將收到的httpd.crt放到/etc/httpd/ssl/下面去備用


本文出自 “奔向互連網” 部落格,請務必保留此出處http://huangbaoying.blog.51cto.com/9267029/1604725

https伺服器的配置(三)建立私人CA和認證

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.