hayden wrote:Could you let me know what tests specifically you're referring to? If you could also attach the full log of the failing test(s), that would be helpful, too, as well as any changes I need to make to the source code to trigger the failure you describe.
I'm also curious about your use case for this option. Are you looking to check every certificate in the chain up to and including the peer's, using stapling for each?
First, I am using certificates in certs/ocsp. I am creating 4 OCSP Responders, one for the root CA cert and one each for the 3 intermediate CA certs. Then I am launching the server app (unmodified) and the client app (initially unmodified). I first test with the -o option on the client and get an error -367, OCSP Responder lookup fail. In Wireshark (trace attached) I see 3 OCSP Requests, one for the root CA cert, one for the intermediate CA cert, and one for the server cert. Here are the commands for this test, each in its own command window:
C:\...\wolfSSL\certs\ocsp>openssl ocsp -port 22220 -index index-ca-and-intermediate-cas.txt -rsigner ocsp-responder-cert.pem -rkey ocsp-responder-key.pem -CA root-ca-cert.pem -nmin 11
C:\...\wolfSSL\certs\ocsp>openssl ocsp -port 22221 -index index-intermediate1-ca-issued-certs.txt -rsigner ocsp-responder-cert.pem -rkey ocsp-responder-key.pem -CA intermediate1-ca-cert.pem -nmin 5
C:\...\wolfSSL\certs\ocsp>openssl ocsp -port 22222 -index index-intermediate2-ca-issued-certs.txt -rsigner ocsp-responder-cert.pem -rkey ocsp-responder-key.pem -CA intermediate2-ca-cert.pem -nmin 6
C:\...\wolfSSL\certs\ocsp>openssl ocsp -port 22223 -index index-intermediate3-ca-issued-certs.txt -rsigner ocsp-responder-cert.pem -rkey ocsp-responder-key.pem -CA intermediate3-ca-cert.pem -nmin 4
C:\...\wolfSSL>Debug\server.exe -v 4 -c certs\ocsp\server1-cert.pem -k certs\ocsp\server1-key.pem
C:\...\wolfSSL>Debug\client.exe -v 4 -A certs\ocsp\root-ca-cert.pem -o
I am thinking the error is due to the root cert being self-signed.
OCSP Stapling works differently. When I change the client code around line 3037 to this:
//wolfSSL_CTX_EnableOCSP(ctx, 0);
wolfSSL_CTX_EnableOCSP(ctx, WOLFSSL_OCSP_CHECKALL);
wolfSSL_CTX_SetOCSP_Cb(ctx, NULL, NULL, NULL);
and run the same as above but change the client to this:
C:\...\wolfSSL>Debug\client.exe -v 4 -A certs\ocsp\root-ca-cert.pem -W 1
I get error -407, Invalid OCSP Status Error. I also see only one OCSP request in the WireShark trace (attached to next post).
Finally, changing the code at line 3037 to this:
wolfSSL_CTX_EnableOCSP(ctx, 0);
//wolfSSL_CTX_EnableOCSP(ctx, WOLFSSL_OCSP_CHECKALL);
wolfSSL_CTX_SetOCSP_Cb(ctx, NULL, NULL, NULL);
and rerunning the last commands results in success. (Wireshark trace attached to last post.)