From: Nikita Popov Date: Mon, 3 Jun 2019 13:14:01 +0000 (+0200) Subject: Clear errors after SSL_CTX_load_verify_locations() X-Git-Tag: php-7.2.20RC1~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ac60007becc7943d1da95ec0f9f92c6a3325ec72;p=php Clear errors after SSL_CTX_load_verify_locations() We report our own errors here. Make sure these don't clog up the error queue. --- diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 9e481c6376..56e5348731 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -871,6 +871,7 @@ static int php_openssl_enable_peer_verification(SSL_CTX *ctx, php_stream *stream if (cafile || capath) { if (!SSL_CTX_load_verify_locations(ctx, cafile, capath)) { + ERR_clear_error(); if (cafile && !php_openssl_load_stream_cafile(SSL_CTX_get_cert_store(ctx), cafile)) { return FAILURE; }