Skip to content

Instantly share code, notes, and snippets.

View hazcod's full-sized avatar

Niels Hofmans hazcod

View GitHub Profile
@hazcod
hazcod / gencert.sh
Last active July 17, 2018 07:39 — forked from martijnvermaat/gencert.sh
Generate self-signed x509 certificates
#!/bin/bash
# Generate a self-signed x509 certificate or certificate signing request and
# key using OpenSSL. DNS and IP addresses can be added as subjectAltName
# entries.
#
# Usage:
# ./gencert.sh <common name (or DNS name)> <DNS names or ip addresses...> [--rsa4096] [--csr]
#
# By default, a 2048 bits RSA key is generated. Supply --rsa4096 at the end to
# generate a 4096 bits key.