Currently, I have an implementation where I send an OCSP request in the verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
function for every intermediate and end-entity certificate. The verify_callback
function is set using the SSL_CTX_set_verify()
function.
Now, I would like to add OCSP stapling to my implementation. I saw the post OpenSSL certificate revocation check in client program using OCSP stapling on how to include OCSP Stapling.
The issue with adding the above OCSP callback is that the verify_callback()
first gets called prior to OCSP Stapling callback function.
My question is how can I have both of them in such a way that, if there is no OCSP stapling response from the server, then the client will itself send the OCSP request.
Is there a way to check if the OCSP stapling is supported or not before we reach the verify_callback()
function?