Skip to content

Instantly share code, notes, and snippets.

@sethvargo
sethvargo / create-certs.sh
Created June 6, 2018 16:20
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.
@pnck
pnck / create-cert.sh
Last active December 2, 2020 10:23 — forked from sethvargo/create-certs.sh
x509 v3 self signed certificate
# Define where to store the generated certs and metadata.
DIR="$(pwd)"
# 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.
cat > "${DIR}/openssl.cnf" << EOF
[req]
default_bits = 2048