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