Making an SSL certificate

Source: Internet
Author: User
Tags openssl x509 pfx file

The previous section describes the directory structure of OpenSSL, which is described in this section for the production of SSL certificates.

After installing OpenSSL, it is recommended to add the bin directory to the system environment variable for later operation.

  1. Create a new directory with SSL dedicated to making certificates.

  2. Create a certificate directory

    We use the default configuration openssl.cfg, then we need to establish the directory Democa required in the configuration, using the script ca.pl

    Ca.pl-newca

    Copy the serial file from the OpenSSL installation directory to the Democa directory.

  3. We do not use the root certificate provided by Democa, make our own root certificate, create the root certificate of the key file Pmroot.key

    PS: Key must be entered

    OpenSSL genrsa-des3-out Pmroot.key

  4. Create a request file for the root certificate PMROOT.CSR

    OpenSSL Req-new-key pmroot.key-out PMROOT.CSR

  5. Create a 10-year root certificate pmroot.crt

    OpenSSL x509-req-days 3650-sha1-extensions v3_ca-signkey pmroot.key-in pmroot.csr-out pmroot.crt

  6. Generate server-side key file Pmserver.key

    OpenSSL genrsa-des3-out Pmserver.key

  7. Generate server-side certificate request file PMSERVER.CSR

    OpenSSL Req-new-key pmserver.key-out PMSERVER.CSR

  8. If you need a client certificate, install the above certificate operation to generate Pmclient.key and PMCLIENT.CSR respectively.

  9. The resulting CSR file must be signed by the CA to form a certificate, signed with the CA certificate that was previously generated for the PMSERVER.CSR,PMCLIENT.CSR file:

    OpenSSL ca-days 3650-in pmserver.csr-out pmserver.crt-cert pmroot.crt-keyfile Pmroot.key

    OpenSSL ca-days 3650-in pmclient.csr-out pmclient.crt-cert pmroot.crt-keyfile Pmroot.key

So all the files we need are generated.

Another: The files used by the client are: Pmroot.crt,pmclient.crt,pmclient.key

The files used by the server are: Pmroot.crt,pmserver.crt,pmserver.key

CRT files and key files can be combined into a PFX file.

Merge command:OpenSSL pkcs12-export-in pmserver.crt-inkey pmserver.key-out pmserver.pfx

Making an SSL 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.