Hi cxdinter,
We have received a few inquiries of this nature over the years. To be absolutely clear let me express that this is
HIGHLY NOT RECOMMENDED by wolfSSL. This can open yourself up to attacks and in general is a bad idea. We can not express how strongly we do not recommend doing what you are requesting. To convey our concern let me provide a real world example.
A certificate belonging to the domain comehereforfreemoney.com is currently on the Certificate Revocation List (CRL) because if you visit that domain it will install a virus on your computer or do some other malicious thing. Once the certificate belonging to that domain expires it drops off the CRL and you can no longer tell it's a certificate belonging to a malicious domain by checking it against the CRL. You decide to trust it because you ignore the date and the CRL is checked and comes back with an OK status since that certificate is no longer tracked by the CRL. Your connection is allowed and you end up with a virus or other malicious behavior is performed due to the approved connection.
Now that you are briefed on the potential pitfalls of ignoring date checks:
Due to the requests over the years we have provided an example of doing this in <wolfssl-root>/wolfssl/test.h
The function "myDateCb" can be used as a model for achieving your desired use-case.
You would create your own custom callback similar to myDateCb and then register that "verify callback" with the API "wolfSSL_CTX_set_verify". Then whenever a verify is performed it will use your callback instead of the default one in wolfSSL.
Example:
int myCustomVerifyFunction(int preverify, WOLFSSL_X509_STORE_CTX* store);
int myCustomVerifyFunction(int preverify, WOLFSSL_X509_STORE_CTX* store)
{
/* Model after myDateCb from <wolfssl-root>/wolfssl/test.h */
/* return 1 for success */
/* return 0 for failures */
}
... application code ...
wolfSSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, myCustomVerifyFunction);
... application code ...
Regards,