openssl: only try engine/provider if a certificate file/name is provided

Bug: https://issues.oss-fuzz.com/issues/435278402

Closes #19197
This commit is contained in:
Daniel Stenberg 2025-10-23 00:53:09 +02:00
parent d51d19bd06
commit 9e15b07638
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1721,12 +1721,12 @@ static CURLcode client_cert(struct Curl_easy *data,
break;
case SSL_FILETYPE_ENGINE:
if(!engineload(data, ctx, cert_file))
if(!cert_file || !engineload(data, ctx, cert_file))
return CURLE_SSL_CERTPROBLEM;
break;
case SSL_FILETYPE_PROVIDER:
if(!providerload(data, ctx, cert_file))
if(!cert_file || !providerload(data, ctx, cert_file))
return CURLE_SSL_CERTPROBLEM;
break;