1
0

external.test 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  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. if ! ./examples/client/client -V | grep -q 3; then
  9. echo 'skipping external.test because TLS1.2 is not available.' 1>&2
  10. exit 77
  11. fi
  12. # cloudflare seems to change CAs quickly, disabled by default
  13. if test -n "$WOLFSSL_EXTERNAL_TEST"; then
  14. BUILD_FLAGS="$(./examples/client/client '-#')"
  15. if echo "$BUILD_FLAGS" | fgrep -q -e ' -DWOLFSSL_SNIFFER '; then
  16. echo 'skipping WOLFSSL_EXTERNAL_TEST because -DWOLFSSL_SNIFFER configuration of build is incompatible.'
  17. exit 77
  18. fi
  19. if echo "$BUILD_FLAGS" | fgrep -v -q -e ' -DHAVE_ECC '; then
  20. echo 'skipping WOLFSSL_EXTERNAL_TEST because -UHAVE_ECC configuration of build is incompatible.'
  21. exit 77
  22. fi
  23. echo "WOLFSSL_EXTERNAL_TEST set, running test..."
  24. else
  25. echo "WOLFSSL_EXTERNAL_TEST NOT set, won't run"
  26. exit 77
  27. fi
  28. # is our desired server there?
  29. "${SCRIPT_DIR}"/ping.test $server 2
  30. RESULT=$?
  31. [ $RESULT -ne 0 ] && exit 0
  32. # client test against the server
  33. ./examples/client/client -X -C -h $server -p 443 -g -A $ca
  34. RESULT=$?
  35. [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
  36. exit 0