add proxying with client certificate test

This commit is contained in:
Omar Polo 2022-01-01 16:33:44 +00:00
parent e6ab6b25fc
commit c064f3de1d
2 changed files with 23 additions and 0 deletions

View File

@ -52,5 +52,6 @@ run_test test_fastcgi
run_test test_macro_expansion
run_test test_174_bugfix
run_test test_proxy_relay_to
run_test test_proxy_with_certs
tests_done

View File

@ -331,3 +331,25 @@ EOF
fetch /
check_reply "20 text/gemini" "# hello world"
}
test_proxy_with_certs() {
gen_config '' 'require client ca "'$PWD'/testca.pem"'
# append config for second host
cat <<EOF >> reg.conf
server "localhost.local" {
cert "$PWD/cert.pem"
key "$PWD/key.pem"
proxy {
relay-to "localhost:$port"
cert "$PWD/valid.crt"
key "$PWD/valid.key"
}
}
EOF
run
ggflags="-P localhost:$port -H localhost.local"
fetch /
check_reply "20 text/gemini" "# hello world"
}