I have an embedded C client program that securely connects to a server using OpenSSL. The server provides its certificate during the handshake and the client has to check the revocation status of this certificate. Currently I do this by using OCSP.
All of this works, but now I need to re-implement the client's revocation check using OCSP stapling (assuming the server will start providing this).
Currently I get the server certificate using X509 *cert = SSL_get_peer_certificate(ssl)
to check the subjectAltName
against my server's domain and get the authorityInfoAccess
(for OCSP URI).
Assuming I have an SSL * ssl;
and I successfully set everything up and connected via SSL_connect(ssl);
, what do I do at this point to get at the OCSP stapling information and verify the certificate I just received? I can't find any sample code for how to actually implement this using the OpenSSL library.