openssl: Support async cert verify callback

- Update the OpenSSL connect state machine to handle
  SSL_ERROR_WANT_RETRY_VERIFY.

This allows libcurl users that are using custom certificate validation
to suspend processing while waiting for external I/O during certificate
validation.

Closes https://github.com/curl/curl/pull/11499
This commit is contained in:
Pablo Busse 2023-06-22 06:13:07 +00:00 committed by Jay Satiro
parent af3f4e419b
commit 11d46bcfb2
2 changed files with 10 additions and 1 deletions

View file

@ -3864,7 +3864,13 @@ static CURLcode ossl_connect_step2(struct Curl_cfilter *cf,
return CURLE_OK;
}
#endif
else if(backend->io_result == CURLE_AGAIN) {
#ifdef SSL_ERROR_WANT_RETRY_VERIFY
if(SSL_ERROR_WANT_RETRY_VERIFY == detail) {
connssl->connecting_state = ssl_connect_2;
return CURLE_OK;
}
#endif
if(backend->io_result == CURLE_AGAIN) {
return CURLE_OK;
}
else {