hs-tls/test-scripts/runtest-gnutls

31 lines
810 B
Text
Raw Normal View History

#!/bin/sh
STUNNEL=./debug/dist/build/tls-stunnel/tls-stunnel
if [ ! -x ${STUNNEL} ]; then
echo "hs-tls stunnel is not present, build with executable flag set."
exit 1
fi
PORT=$(($$ % 10000 + 10000))
if [ ! -f server.rsa.crt ]; then
echo "generate some certificate \"server.rsa.crt\""
exit 2
fi
if [ ! -f server.rsa.key ]; then
echo "generate some private key \"server.rsa.key\""
exit 2
fi
echo "running stunnel"
2013-12-29 07:14:08 +00:00
${STUNNEL} server --dhparams dhparams --certificate server.rsa.crt --key server.rsa.key --certificate server.dsa.crt --key server.dsa.key --source=localhost:${PORT} --destination-type=fd --debug --destination=2 > stunnel-gnutls-log 2>&1 &
stunnelpid=$(pidof stunnel)
STUNNELPID=$!
sleep 1
echo "starting gnutls cli debug"
gnutls-cli-debug localhost -p ${PORT} -V -V
kill ${STUNNELPID}