OpenSSL generates an SSL certificate (HTTPS enabled)

Source: Internet
Author: User
Tags openssl x509 nginx server ssl certificate

One: Environment and installation instructions

Win7_64,nginx Server,OpenSSL_Win64. I use the Phpstudy integrated development environment, using nginx+php to support browser HTTPS requests.

Nginx:Http://nginx.org/en/download.html 
OpenSSL:Http://slproweb.com/products/Win32OpenSSL.html 
website Address:https://www.openssl.org/source/


II: Installation of OpenSSL and configuration

1> download after double-click Install, default installation path is C:\OpenSSL-Win64

2> configuration environment variables, here do not elaborate, skip.

Three: Generate an SSL certificate

1> First, either under Linux or in Cygwin under Windows, you must confirm that the OpenSSL package is installed before doing the following.

2> Create the root certificate key file Myopenssl.key, enter the following command: OpenSSL genrsa-des3-out myopenssl.key

This will prompt you to enter the password two times, please keep the password consistent two times

      Enter pass phrase for root.key:← input a new password  
      Verifying–enter pass phrase for root.key:← re-enter the password again

   3> Create the application file for the root certificate MYOPENSSL.CSR, enter the following command:  openssl req-new-key myopenssl . Key-out MYOPENSSL.CSR

      

The following is a hint message   

Enter pass phrase for root.key:← type the password you created earlier
You is about-to is asked to-enter information that'll be incorporated
into your certificate request.
What's about-to-enter is called a distinguished Name or a DN.
There is quite a few fields but can leave some blank
For some fields there would be a default value,
If you enter '. ', the field would be a left blank.
—–
Country Name (2 letter code) [au]:cn← Country Code, China input CN
State or province name (full name) [some-state]:beijing← Province, pinyin
Locality name (eg, city) [Full name of]:beijing←, pinyin
Organization name (eg, company) [Internet widgits Pty ltd]:mycompany corp.← Corporation English name
Organizational Unit Name (eg, section) []:← can not enter
Common name (eg, YOUR name) []:← not entered at this time
email address []:[email protected]← e-mail address, can be filled in freely

Please enter the following ' extra ' attributes
To is sent with your certificate request
A Challenge Password []:← can not enter
An optional company name []:← can not enter

4> Create a root certificate myopenssl.crt that lasts for 10 years from the current date, enter the following command: openssl x509-req-days 3650-sha1-extensions v3_ca-signkey myopenssl . key-in myopenssl . Csr-out myopenssl . CRT

     

      The following is a hint:

     enter Pass phrase for root.key:← Enter the password you created earlier


OpenSSL generates an SSL certificate (HTTPS enabled)

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.