2
0

external.test 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. # external.test
  3. SCRIPT_DIR="$(dirname "$0")"
  4. server=www.wolfssl.com
  5. ca=./certs/wolfssl-website-ca.pem
  6. [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
  7. # www.wolfssl.com isn't using RFC 8446 yet but the draft instead.
  8. ./examples/client/client -v 3 2>&1 | grep -- 'Bad SSL version'
  9. if [ $? -ne 0 ]; then
  10. # cloudflare seems to change CAs quickly, disabled by default
  11. if test -n "$WOLFSSL_EXTERNAL_TEST"; then
  12. BUILD_FLAGS="$(./examples/client/client '-#')"
  13. if echo "$BUILD_FLAGS" | fgrep -q -e ' -DWOLFSSL_SNIFFER '; then
  14. echo 'skipping WOLFSSL_EXTERNAL_TEST because -DWOLFSSL_SNIFFER configuration of build is incompatible.'
  15. exit 0
  16. fi
  17. if echo "$BUILD_FLAGS" | fgrep -v -q -e ' -DHAVE_ECC '; then
  18. echo 'skipping WOLFSSL_EXTERNAL_TEST because -UHAVE_ECC configuration of build is incompatible.'
  19. exit 0
  20. fi
  21. echo "WOLFSSL_EXTERNAL_TEST set, running test..."
  22. else
  23. echo "WOLFSSL_EXTERNAL_TEST NOT set, won't run"
  24. exit 0
  25. fi
  26. # is our desired server there?
  27. ${SCRIPT_DIR}/ping.test $server 2
  28. RESULT=$?
  29. [ $RESULT -ne 0 ] && exit 0
  30. # client test against the server
  31. ./examples/client/client -X -C -h $server -p 443 -g -A $ca
  32. RESULT=$?
  33. [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
  34. fi
  35. exit 0