aboutsummaryrefslogtreecommitdiff
path: root/websockets/generate_cert.sh
blob: 26315a1a5eba9f36ac8414e54596fd869f270bf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash
if [[ $# -ne 2 ]]; then
	echo >&2 "Usage: $0 <key.pem> <cert.pem>"
	echo >&2 "<key.pem> is the filename for the private key; <cert.pem> 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'