Skip to content

Instantly share code, notes, and snippets.

@gnurag
Created June 14, 2019 13:38
Show Gist options
  • Save gnurag/930a56f23ec8da25f002f6616716b35e to your computer and use it in GitHub Desktop.
Save gnurag/930a56f23ec8da25f002f6616716b35e to your computer and use it in GitHub Desktop.
Custom certificates signed by Custom CA
# Create Custom CA key
$ openssl genrsa -des3 -out ExampleCA.key 4096
# Create an sign Custom CA
$ openssl req -x509 -new -nodes -key ExampleCA.key -sha256 -days 3650 -out ExampleCA.crt
# Generate a Custom Certificate key
$ openssl genrsa -out example.com.key 2048
# Generate Custom Certificate Signing Request
$ openssl req -new -key example.com.key -out example.com.csr
# Verify Certificate Signing Request
$ openssl req -in example.com.csr -noout -text
# Sign Custom Certificate with Custom CA
$ openssl x509 -req -in example.com.csr -CA ExampleCA.crt -CAkey ExampleCA.key -CAcreateserial -out example.com.crt -days 3650 -sha256
# Verify Custom Certificate
$ openssl x509 -in example.com.crt -text -noout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment