Use OpenSSL to generate a self-signed certificate

Source: Internet
Author: User
Tags openssl x509

Method 1:

Generate Private Key

OpenSSL genrsa-out server. Key 1024

Generate a self-Signed CER Certificate Format file with the private key
OpenSSL req-New-X509-days 3650-key server. key-out server. CRT-subj "/C = Cn/ST = mykey/L = mykey/o = mykey/ou = mykey/CN = domain1/CN = domain2/CN = domain3"

Method 2:

Generate Private Key

OpenSSL genrsa-out server. Key 1024

Generate Certificate Application Based on Private Key

OpenSSL req-New-key server. Key-out server. CSR

Sign the certificate application with the private key to generate a certificate

OpenSSL X509-req-in server. CSR-out server. CRT-signkey server. Key-days 3650.

Method 3:

OpenSSL req-New-X509-keyout server. Key-out server. CRT-config OpenSSL. CNF

The server. CRT certificate generated above is in the PEM format.

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.