123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #!/bin/sh
- # ocsp-stapling.test
- trap 'for i in `jobs -p`; do pkill -TERM -P $i; done' EXIT
- server=login.live.com
- ca=certs/external/baltimore-cybertrust-root.pem
- [ ! -x ./examples/client/client ] && echo -e "\n\nClient doesn't exist" && exit 1
- ./examples/client/client -? 2>&1 | grep -- 'Client not compiled in!'
- if [ $? -eq 0 ]; then
- exit 0
- fi
- # is our desired server there? - login.live.com doesn't answers PING
- #./scripts/ping.test $server 2
- # client test against the server
- ./examples/client/client -X -C -h $server -p 443 -A $ca -g -W 1
- RESULT=$?
- [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
- # Test with example server
- ./examples/server/server -? 2>&1 | grep -- 'Server not compiled in!'
- if [ $? -eq 0 ]; then
- exit 0
- fi
- # setup ocsp responder
- ./certs/ocsp/ocspd-intermediate1-ca-issued-certs.sh &
- sleep 1
- [ $(jobs -r | wc -l) -ne 1 ] && echo -e "\n\nSetup ocsp responder failed, skipping" && exit 0
- # client test against our own server - GOOD CERT
- ./examples/server/server -c certs/ocsp/server1-cert.pem -k certs/ocsp/server1-key.pem &
- sleep 1
- ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 1
- RESULT=$?
- [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
- # client test against our own server - REVOKED CERT
- ./examples/server/server -c certs/ocsp/server2-cert.pem -k certs/ocsp/server2-key.pem &
- sleep 1
- ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 1
- RESULT=$?
- [ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1
- ./examples/client/client -v 4 2>&1 | grep -- 'Bad SSL version'
- if [ $? -ne 0 ]; then
- # client test against our own server - GOOD CERT
- ./examples/server/server -c certs/ocsp/server1-cert.pem -k certs/ocsp/server1-key.pem -v 4 &
- sleep 1
- ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 1 -v 4 -F 1
- RESULT=$?
- [ $RESULT -ne 0 ] && echo -e "\n\nClient connection failed" && exit 1
- # client test against our own server - REVOKED CERT
- ./examples/server/server -c certs/ocsp/server2-cert.pem -k certs/ocsp/server2-key.pem -v 4 &
- sleep 1
- ./examples/client/client -C -A certs/ocsp/root-ca-cert.pem -W 1 -v 4 -F 1
- RESULT=$?
- [ $RESULT -ne 1 ] && echo -e "\n\nClient connection suceeded $RESULT" && exit 1
- fi
- exit 0
|