google.test 812 B

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