ocsp.test 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. # ocsp-stapling.test
  3. server=www.globalsign.com
  4. ca=certs/external/ca-globalsign-root.pem
  5. [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
  6. # is our desired server there?
  7. ./scripts/ping.test $server 2
  8. RESULT=$?
  9. if [ $RESULT = 0 ]; then
  10. # client test against the server
  11. ./examples/client/client -X -C -h $server -p 443 -A $ca -g -o -N
  12. GL_RESULT=$?
  13. [ $GL_RESULT -ne 0 ] && echo -e "\n\nClient connection failed"
  14. else
  15. GL_RESULT=1
  16. fi
  17. server=www.google.com
  18. ca=certs/external/ca-google-root.pem
  19. # is our desired server there?
  20. ./scripts/ping.test $server 2
  21. RESULT=$?
  22. if [ $RESULT = 0 ]; then
  23. # client test against the server
  24. ./examples/client/client -X -C -h $server -p 443 -A $ca -g -o -N
  25. GR_RESULT=$?
  26. [ $GR_RESULT -ne 0 ] && echo -e "\n\nClient connection failed"
  27. else
  28. GR_RESULT=1
  29. fi
  30. if test -n "$WOLFSSL_OCSP_TEST"; then
  31. # check that both passed
  32. if [ $GL_RESULT = 0 ] && [ $GR_RESULT = 0 ]; then
  33. echo "\n\nBoth OCSP connection to globalsign and google passed"
  34. exit 0
  35. else
  36. echo "\n\nBoth OCSP connection to globalsign and google failed"
  37. exit 1
  38. fi
  39. else
  40. # if environment variable is not set then just need one to pass
  41. if [ $GL_RESULT -ne 0 ] && [ $GR_RESULT -ne 0 ]; then
  42. echo "\n\nBoth OCSP connection to globalsign and google failed"
  43. exit 1
  44. else
  45. echo "\n\nWOLFSSL_OCSP_TEST NOT set, and 1 of the tests passed"
  46. exit 0
  47. fi
  48. fi