stunnel4/tests/recipes/035_SNI

44 lines
952 B
Plaintext
Raw Normal View History

2018-03-29 12:42:35 +02:00
#!/bin/sh
. $(dirname $0)/../test_library
start() {
../../src/stunnel -fd 0 <<EOT
debug = debug
syslog = no
pid = ${result_path}/stunnel.pid
output = ${result_path}/stunnel.log
[https client]
client = yes
accept = 127.0.0.1:${http1}
connect = 127.0.0.1:${https}
sni = sni.mydomain.com
cert = ${script_path}/certs/client_cert.pem
[virtual]
accept = 127.0.0.1:${https}
cert = ${script_path}/certs/server_cert.pem
exec = ${script_path}/execute
execArgs = execute 035_SNI_error
[sni]
sni = virtual:sni.mydomain.com
cert = ${script_path}/certs/server_cert.pem
exec = ${script_path}/execute
execArgs = execute 035_SNI
verifyPeer = yes
CAfile = ${script_path}/certs/PeerCerts.pem
EOT
}
check_ports "035_SNI"
if grep -q "OpenSSL 1" "results.log"
then
start 2> "error.log"
test_log_for "035_SNI" "execute" "$1" 2>> "stderr.log"
exit $?
else
exit_logs "035_SNI" "skipped"
exit 125
fi