1#!/usr/bin/env bash 2set -euo pipefail 3shopt -s inherit_errexit 4 5cd -- "$(dirname -- "${BASH_SOURCE[0]}")" 6 7if [ ! -f key.pem ]; then 8 openssl genrsa -out key.pem 2048 9fi 10 11openssl req -sha256 -new -key key.pem -subj "/CN=localhost" | \ 12 openssl x509 -req -extfile cert.conf -extensions v3_req -days 3650 -signkey key.pem -out cert.pem 13openssl x509 -in cert.pem -noout -text 14