tlsrp

A simple TLS reverse proxy
git clone git://nihaljere.xyz/tlsrp
Log | Files | Refs | README | LICENSE

commit 64fc3d43db6a313108a23a951d041dac73840d88
parent 0d341119e44aa1d8d2e61f5f21f99e407eec845f
Author: Nihal Jere <nihal@nihaljere.xyz>
Date:   Wed, 29 Jul 2020 18:45:11 -0500

improve local testing: add a script to generate appropriate
certificates.

Diffstat:
M.gitignore | 2++
ACA/certgen.sh | 21+++++++++++++++++++++
MMakefile | 2+-
3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore @@ -1,2 +1,4 @@ tlsrp config.h +CA/* +!CA/certgen.sh diff --git a/CA/certgen.sh b/CA/certgen.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# This script generates certificates that will be used in "make test". + +# generate root key +openssl ecparam -out root.key -name prime256v1 -genkey + +# create certificate signing request +openssl req -new -sha256 -key root.key -out root.csr -subj '/CN=localhost' + +# sign root key to create certificate +openssl x509 -req -sha256 -days 365 -in root.csr -signkey root.key -out root.crt + +# create tlsrp test key +openssl ecparam -out tlsrp.key -name prime256v1 -genkey + +# gen csr +openssl req -new -sha256 -key tlsrp.key -out tlsrp.csr -subj '/CN=localhost' + +# sign tlsrp key using root key to create cert +openssl x509 -req -in tlsrp.csr -CA root.crt -CAkey root.key -CAcreateserial -out tlsrp.crt -days 365 -sha256 diff --git a/Makefile b/Makefile @@ -15,4 +15,4 @@ clean: rm -f $(OBJ) tlsrp test: tlsrp - LD_LIBRARY_PATH=/usr/lib/libressl ./tlsrp -U "/tmp/conn.socket" -f 443 -a "CA/root.pem" -r "CA/server.crt" -k "CA/server.key" + LD_LIBRARY_PATH=/lib/libressl ./tlsrp -U "/tmp/conn.socket" -f 443 -a "CA/root.pem" -r "CA/tlsrp.crt" -k "CA/tlsrp.key"