2011-12-05 08:39:02 +00:00
|
|
|
#!/bin/sh
|
2012-09-25 07:04:18 +00:00
|
|
|
STUNNEL=./debug/dist/build/tls-stunnel/tls-stunnel
|
2011-12-05 08:39:02 +00:00
|
|
|
|
|
|
|
if [ ! -x ${STUNNEL} ]; then
|
|
|
|
echo "hs-tls stunnel is not present, build with executable flag set."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
PORT=$(($$ % 10000 + 10000))
|
|
|
|
|
2013-02-09 14:20:01 +00:00
|
|
|
if [ ! -f server.crt ]; then
|
|
|
|
echo "generate some certificate \"server.crt\""
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f server.key ]; then
|
|
|
|
echo "generate some private key \"server.key\""
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2011-12-05 08:39:02 +00:00
|
|
|
echo "running stunnel"
|
2013-07-23 07:59:45 +00:00
|
|
|
${STUNNEL} server --certificate server.crt --key server.key --source=localhost:${PORT} --destination-type=fd --destination=2 > stunnel-gnutls-log 2>&1 &
|
2011-12-05 08:39:02 +00:00
|
|
|
stunnelpid=$(pidof stunnel)
|
|
|
|
STUNNELPID=$!
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
echo "starting gnutls cli debug"
|
2012-09-25 07:04:37 +00:00
|
|
|
gnutls-cli-debug localhost -p ${PORT} -VV
|
2011-12-05 08:39:02 +00:00
|
|
|
|
|
|
|
kill ${STUNNELPID}
|