ocsp-stapling2.test 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/sh
  2. # ocsp-stapling.test
  3. trap 'for i in `jobs -p`; do pkill -TERM -P $i; done' EXIT
  4. [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
  5. # setup ocsp responders
  6. ./certs/ocsp/ocspd-root-ca-and-intermediate-cas.sh &
  7. ./certs/ocsp/ocspd-intermediate2-ca-issued-certs.sh &
  8. ./certs/ocsp/ocspd-intermediate3-ca-issued-certs.sh &
  9. sleep 1
  10. [ $(jobs -r | wc -l) -ne 3 ] && echo -e "\n\nSetup ocsp responder failed, skipping" && exit 0
  11. # client test against our own server - GOOD CERTS
  12. ./examples/server/server -c certs/ocsp/server3-cert.pem -k certs/ocsp/server3-key.pem &
  13. sleep 1
  14. ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 1
  15. RESULT=$?
  16. [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
  17. ./examples/server/server -c certs/ocsp/server3-cert.pem -k certs/ocsp/server3-key.pem &
  18. sleep 1
  19. ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 2
  20. RESULT=$?
  21. [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
  22. # client test against our own server - REVOKED SERVER CERT
  23. ./examples/server/server -c certs/ocsp/server4-cert.pem -k certs/ocsp/server4-key.pem &
  24. sleep 1
  25. ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 1
  26. RESULT=$?
  27. [ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1
  28. ./examples/server/server -c certs/ocsp/server4-cert.pem -k certs/ocsp/server4-key.pem &
  29. sleep 1
  30. ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 2
  31. RESULT=$?
  32. [ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1
  33. # client test against our own server - REVOKED INTERMEDIATE CERT
  34. ./examples/server/server -c certs/ocsp/server5-cert.pem -k certs/ocsp/server5-key.pem &
  35. sleep 1
  36. ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 1
  37. RESULT=$?
  38. [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed $RESULT" && exit 1
  39. ./examples/server/server -c certs/ocsp/server5-cert.pem -k certs/ocsp/server5-key.pem &
  40. sleep 1
  41. ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 2
  42. RESULT=$?
  43. [ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1
  44. exit 0