xref: /openssl/demos/certs/ocspquery.sh (revision bcd92754)
1#!/bin/sh
2
3# Example querying OpenSSL test responder. Assumes ocsprun.sh has been
4# called.
5
6opensslcmd() {
7    LD_LIBRARY_PATH=../.. ../../apps/openssl $@
8}
9
10OPENSSL_CONF=../../apps/openssl.cnf
11export OPENSSL_CONF
12
13opensslcmd version
14
15# Send responder queries for each certificate.
16
17echo "Requesting OCSP status for each certificate"
18opensslcmd ocsp -issuer intca.pem -cert client.pem -CAfile root.pem \
19			-url http://127.0.0.1:8888/
20opensslcmd ocsp -issuer intca.pem -cert server.pem -CAfile root.pem \
21			-url http://127.0.0.1:8888/
22opensslcmd ocsp -issuer intca.pem -cert rev.pem -CAfile root.pem \
23			-url http://127.0.0.1:8888/
24# One query for all three certificates.
25echo "Requesting OCSP status for three certificates in one request"
26opensslcmd ocsp -issuer intca.pem \
27	-cert client.pem -cert server.pem -cert rev.pem \
28	-CAfile root.pem -url http://127.0.0.1:8888/
29