Last active
May 21, 2021 08:48
-
-
Save dcmwong/871d567433ab95b07bb3803e223745a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Private key for the root cert | |
openssl genrsa -out private.key 4096 | |
# root certificate | |
openssl req -x509 -new -nodes -key private.key -subj "/C=<YOUR COUNTRY CODE>/ST=<YOUR STATE>/O=<YOUR ORG>/CN=<YOUR DOMAIN>" -sha256 -days 365 -out public.crt | |
# Private key for the server cert | |
openssl genrsa -out server.key 2048 | |
# Signing request for the server | |
# openssl req -new -key stubhub.key -out stubhub.csr | |
openssl req -new -key server.key -subj "/C=<YOUR COUNTRY CODE>/ST=<YOUR STATE>/O=<YOUR ORG>/CN=<YOUR DOMAIN>" -out server.csr | |
# Server cert using the root certificate | |
openssl x509 -req -in server.csr -CA public.crt -CAkey private.key -CAcreateserial -out server.crt -days 365 -sha256 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generates all certificates to be used on a TLS server