Skip to content

Instantly share code, notes, and snippets.

@johnhpatton
Created April 3, 2021 22:10
Show Gist options
  • Save johnhpatton/0f34c7a9e7f0a5a4ea4e5126d3c5061e to your computer and use it in GitHub Desktop.
Save johnhpatton/0f34c7a9e7f0a5a4ea4e5126d3c5061e to your computer and use it in GitHub Desktop.
Create a Local CA root certificate.
#!/usr/bin/env bash
# Create the CA root signing key
openssl genrsa -out "./ca.key" 2048
# Create the CA root certificate
openssl req -x509 -new -nodes \
-days 3650 \
-reqexts v3_req \
-extensions v3_ca \
-subj "/CN=Local CA Root" \
-key "./ca.key" \
-out "./ca.pem"
echo "Local CA root certificate (ca.pem) and key (ca.key) have been created."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment