external.test 895 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. # external.test
  3. server=www.wolfssl.com
  4. ca=./certs/wolfssl-website-ca.pem
  5. [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
  6. # www.wolfssl.com isn't using RFC 8446 yet but the draft instead.
  7. ./examples/client/client -v 3 2>&1 | grep -- 'Bad SSL version'
  8. if [ $? -ne 0 ]; then
  9. # cloudflare seems to change CAs quickly, disabled by default
  10. if test -n "$WOLFSSL_EXTERNAL_TEST"; then
  11. echo "WOLFSSL_EXTERNAL_TEST set, running test..."
  12. else
  13. echo "WOLFSSL_EXTERNAL_TEST NOT set, won't run"
  14. exit 0
  15. fi
  16. # is our desired server there?
  17. ./scripts/ping.test $server 2
  18. RESULT=$?
  19. [ $RESULT -ne 0 ] && exit 0
  20. # client test against the server
  21. ./examples/client/client -X -C -h $server -p 443 -g -A $ca
  22. RESULT=$?
  23. [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
  24. fi
  25. exit 0