Files

8 lines
405 B
Bash
Executable File

#!/usr/bin/env bash
# Self-signed certificate for localhost / 127.0.0.1, valid 30 days. Only the test server uses it.
set -euo pipefail
cd "$(dirname "$0")/.."; mkdir -p certs
openssl req -x509 -newkey rsa:2048 -nodes -days 30 -keyout certs/key.pem -out certs/cert.pem \
-subj "/CN=localhost" -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" 2>/dev/null
echo "wrote certs/cert.pem and certs/key.pem"