Add script to generate a self-signed certificate and key for testing. - geomyidae - A small C-based gopherd. HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 08ff73b18394277a0d1de1f83174035b0ef6c0ad DIR parent 07240d76fd8e1d0a67c49bf7e123bb508613e691 HTML Author: Christoph Lohmann <20h@r-36.net> Date: Sun, 7 Jun 2020 19:02:49 +0200 Add script to generate a self-signed certificate and key for testing. Diffstat: A tls-gen-selfsign-cert.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+), 0 deletions(-) --- DIR diff --git a/tls-gen-selfsign-cert.sh b/tls-gen-selfsign-cert.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +keyfile="geomyidae.key" +csrfile="geomyidae.csr" +certfile="geomyidae.crt" + +# Generate the private key. +openssl genrsa -out "${keyfile}" 4096 +# Generate signing request. +openssl req -new -key "${keyfile}" -out "${csrfile}" +# Sign the request ourself. +openssl x509 -sha256 -req -days 365 -in "${csrfile}" \ + -signkey "${keyfile}" -out "${certfile}" +