#!/usr/bin/env bash if [[ $# -ne 2 ]]; then echo >&2 "Usage: $0 " echo >&2 " is the filename for the private key; is the filename for" echo >&2 "the public certificate." exit 1 fi keyfile="$1" certfile="$2" openssl req -x509 -newkey rsa:4096 -keyout "$keyfile" -out "$certfile" -nodes -subj '/CN=localhost'