Skip to content

Instantly share code, notes, and snippets.

View halukasama's full-sized avatar
🐱

能力不行 halukasama

🐱
  • beijing
View GitHub Profile
@halukasama
halukasama / create-certs.sh
Created November 4, 2019 01:52 — forked from sethvargo/create-certs.sh
Use openssl to create an x509 self-signed certificate authority (CA), certificate signing request (CSR), and resulting private key with IP SAN and DNS SAN
# Define where to store the generated certs and metadata.
DIR="$(pwd)/tls"
# Optional: Ensure the target directory exists and is empty.
rm -rf "${DIR}"
mkdir -p "${DIR}"
# Create the openssl configuration file. This is used for both generating
# the certificate as well as for specifying the extensions. It aims in favor
# of automation, so the DN is encoding and not prompted.