Last active
April 22, 2018 19:58
-
-
Save tyrannosaurusjames/5d27913dddde5b5c92794b68a97e2309 to your computer and use it in GitHub Desktop.
Setup wildcard cert for local development
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
# Assumed go is already installed somewhere | |
# Set the Go PATH (this is where go installs binaries/packages/source code) | |
export GOPATH=/home/james/go | |
# install easypki | |
go get github.com/google/easypki/cmd/easypki | |
# Add Go bin directory to PATH | |
export PATH=/home/james/go/bin:$PATH | |
# Create a directory to hold certs | |
mkdir /home/james/pki | |
# Define some details for cert creation | |
export PKI_ROOT=/home/james/pki | |
export PKI_ORGANIZATION="James Dev Ltd." | |
export PKI_ORGANIZATIONAL_UNIT="Web development" | |
export PKI_COUNTRY=NZ | |
export PKI_LOCALITY="Wellington" | |
export PKI_PROVINCE="Wellington" | |
# Create a root certificate authority | |
easypki create --filename james-dev-root --ca "James Dev Ltd. Certificate Authority" | |
# Create a wildcard cert (for *.james.dev in this case) signed by our root CA | |
easypki create --ca-name james-dev-root --dns "james.dev" --dns "*.james.dev" "james.dev" | |
# Import the root CA cert (/home/james/pki/james-dev-root/certs/james-dev-root.crt) into your browser or your OS's CA store | |
# Use the wildcard cert & key (/home/james/pki/james-dev-root/certs/james.dev.crt & /home/james/pki/james-dev-root/keys/james.dev.key) | |
# as the cert for any locally setup sites |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add CA cert in Ubuntu: (makes curl work)