aboutsummaryrefslogtreecommitdiff
path: root/websockets/generate_cert.sh
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-06-27 21:37:22 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-06-27 21:37:22 +0200
commite86deffd9c387f0912eb392cf23cb08aa3ea4c1e (patch)
tree228ba20416bb059cdea37a286dbed3c5bf37a6b8 /websockets/generate_cert.sh
parent1677af7e078261d52c5a0e83db051eacb2da0038 (diff)
websockets: Fix https support
Diffstat (limited to 'websockets/generate_cert.sh')
-rwxr-xr-xwebsockets/generate_cert.sh11
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'