Skip to content

Instantly share code, notes, and snippets.

@AasSuhendar
Last active September 11, 2020 07:23
Show Gist options
  • Save AasSuhendar/160cd4204cf3145cd34e3b3853b913cf to your computer and use it in GitHub Desktop.
Save AasSuhendar/160cd4204cf3145cd34e3b3853b913cf to your computer and use it in GitHub Desktop.

CSR Generation: Using OpenSSL (Apache w/mod_ssl, NGINX, OS X)

A CSR is a file containing your certificate application information, including your Public Key. Generate keys and certificate: To generate a pair of private key and public Certificate Signing Request (CSR) for a webserver, "server", use the following command :

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/private.key -out /etc/ssl/certs/cert.crt

This creates a two files. The file myserver.key contains a private key; do not disclose this file to anyone. Carefully protect the private key.

CSR Decode : Using OpenSSL

You can easily decode your CSR to see what is in CSR.

openssl req -in server.csr -noout -text

CRT Decode : Using OpenSSL

You can easily decode your CRT to see what is in CRT.

openssl x509 -in server.crt -noout -text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment