Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save xyzkpz/213b5ae8bc6b790c917306523ef48ab5 to your computer and use it in GitHub Desktop.

Select an option

Save xyzkpz/213b5ae8bc6b790c917306523ef48ab5 to your computer and use it in GitHub Desktop.

Revisions

  1. @taoyuan taoyuan revised this gist Aug 7, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions ssc.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 \
    -subj "/C=GB/ST=London/L=London/O=Global Security/OU=R&D Department/CN=example.com" \
    -keyout cert.key -out cert.crt
  2. @taoyuan taoyuan created this gist Aug 7, 2020.
    16 changes: 16 additions & 0 deletions generate_self_signed_certification.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    ## Generation of a Self Signed Certificate
    Generation of a self-signed SSL certificate involves a simple 3-step procedure:

    __STEP 1__: Create the server private key
    ```sh
    openssl genrsa -out cert.key 2048
    ```
    __STEP 2__: Create the certificate signing request (CSR)
    ```sh
    openssl req -new -key cert.key -out cert.csr
    ```
    __STEP 3__: Sign the certificate using the private key and CSR
    ```sh
    openssl x509 -req -days 3650 -in cert.csr -signkey cert.key -out cert.crt
    ```
    Congratulations! You now have a self-signed SSL certificate valid for 10 years.