google.test 859 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. # google.test
  3. server=www.google.com
  4. [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
  5. ./examples/client/client -v 3 2>&1 | grep -- 'Bad SSL version'
  6. if [ $? -eq 0 ]; then
  7. echo -e "\n\nClient doesn't support TLS v1.2"
  8. exit 0
  9. fi
  10. # is our desired server there?
  11. ./scripts/ping.test $server 2
  12. RESULT=$?
  13. [ $RESULT -ne 0 ] && exit 0
  14. # client test against the server
  15. ./examples/client/client -X -C -h $server -p 443 -g -d
  16. RESULT=$?
  17. [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
  18. ./examples/client/client -v 4 2>&1 | grep -- 'Bad SSL version'
  19. if [ $? -ne 0 ]; then
  20. # client test against the server using TLS v1.3
  21. ./examples/client/client -v 4 -X -C -h $server -p 443 -g -d
  22. RESULT=$?
  23. [ $RESULT -ne 0 ] && echo -e "\n\nTLSv1.3 Client connection failed" && exit 1
  24. fi
  25. exit 0