CentOS system generates SSL digital certificate

Source: Internet
Author: User

An SSL certificate is a digital certificate, similar to an electronic copy of a driver's license, passport, and business license. This is also known as an SSL server certificate because it is configured on the server. SSL certificates are compliant with the SSL protocol, issued by a trusted Digital certification authority CA (such as Globalsign,wosign), after authenticating the server, with server authentication and data transfer encryption. The 1024-bit RSA asymmetric encryption algorithm is used for encryption.

1. Check to see if httpd and SSL are installed (if available, proceed to the next step)

[root@localhost~]# rpm -qa | grep httpdhttpd-tools-2.2.15-47.el6.centos.4.x86_64[root@localhost~]# rpm -qa | grep sslopenssl-1.0.1e-42.el6_7.4.x86_64openssl-devel-1.0.1e-42.el6_7.4.x86_64docbook-style-dsssl-1.79-10.el6.noarchmod_ssl-2.2.15-47.el6.centos.4.x86_64nss_compat_ossl-0.9.6-1.el6.x86_64

2. Generate the server private key

[root @localhost  < Code class= "Java Plain" >/]# cd  /etc/pki/tls [root @localhost  tls]# OpenSSL genrsa-out Server.key   1024 generating rsa  private  KEY,&NBSP; 1024  BIT&NBSP; long  modulus .............++++++ ..... ++++++ e is    ( 0x10001 )

3. Generate a certificate with the private key Server.key file Request file CSR

[root@localhosttls]# openssl req -new-key server.key -out server.csrCountry Name (2letter code) [XX]:Chinastring is too long, it needs to be less than 2bytes longCountry Name (2letter code) [XX]:CNState or Province Name (full name) []:zhejiangLocality Name (eg, city) [Default City]:hangzhouOrganization Name (eg, company) [Default Company Ltd]:CQOrganizational Unit Name (eg, section) []:cqxxCommon Name (eg, your name or your server‘s hostname) []:www.jbhjbh.comEmail Address []:cuilingli@jbhjbh.com

When the above steps are complete, you will be asked to enter a password:

A challenge password []:An optional company name []:

Don't bother him.

4. Generate a certificate file

[root@localhosttls]# openssl x509 -days 365-req -in server.csr -signkey server.key -out server.crt

The results are as follows

Signature oksubject=/C=CN/ST=zhejiang/L=hangzhou/O=CQ/OU=cqxx/CN=www.jbhjbh.com/emailAddress=cuilingli@jbhjbh.comGetting Private key

CentOS system generates SSL digital certificate

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.