2022-03-09 12:28:22 -06:00
|
|
|
#!/bin/bash
|
2014-03-19 21:20:43 -07:00
|
|
|
|
2015-06-09 08:51:55 -07:00
|
|
|
# google.test
|
|
|
|
|
|
|
|
|
|
server=www.google.com
|
2014-03-19 21:20:43 -07:00
|
|
|
|
|
|
|
|
[ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
|
|
|
|
|
|
2018-05-17 09:08:03 +10:00
|
|
|
./examples/client/client -v 3 2>&1 | grep -- 'Bad SSL version'
|
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
|
echo -e "\n\nClient doesn't support TLS v1.2"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
2014-03-19 21:20:43 -07:00
|
|
|
# is our desired server there?
|
2016-04-01 15:45:53 -07:00
|
|
|
./scripts/ping.test $server 2
|
2016-04-14 14:42:01 -06:00
|
|
|
RESULT=$?
|
|
|
|
|
[ $RESULT -ne 0 ] && exit 0
|
2014-03-19 21:20:43 -07:00
|
|
|
|
|
|
|
|
# client test against the server
|
2015-06-09 08:51:55 -07:00
|
|
|
./examples/client/client -X -C -h $server -p 443 -g -d
|
2014-03-19 21:20:43 -07:00
|
|
|
RESULT=$?
|
|
|
|
|
[ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
|
|
|
|
|
|
2021-09-09 12:19:50 +10:00
|
|
|
./examples/client/client -v 4 2>&1 | grep -- 'Bad SSL version'
|
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
|
# client test against the server using TLS v1.3
|
|
|
|
|
./examples/client/client -v 4 -X -C -h $server -p 443 -g -d
|
|
|
|
|
RESULT=$?
|
|
|
|
|
[ $RESULT -ne 0 ] && echo -e "\n\nTLSv1.3 Client connection failed" && exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2014-03-19 21:20:43 -07:00
|
|
|
exit 0
|