diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2020-06-27 21:37:22 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2020-06-27 21:37:22 +0200 |
commit | e86deffd9c387f0912eb392cf23cb08aa3ea4c1e (patch) | |
tree | 228ba20416bb059cdea37a286dbed3c5bf37a6b8 /websockets/generate_cert.sh | |
parent | 1677af7e078261d52c5a0e83db051eacb2da0038 (diff) |
websockets: Fix https support
Diffstat (limited to 'websockets/generate_cert.sh')
-rwxr-xr-x | websockets/generate_cert.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/websockets/generate_cert.sh b/websockets/generate_cert.sh new file mode 100755 index 0000000..26315a1 --- /dev/null +++ b/websockets/generate_cert.sh @@ -0,0 +1,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' |