From ac60007becc7943d1da95ec0f9f92c6a3325ec72 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 3 Jun 2019 15:14:01 +0200 Subject: [PATCH] Clear errors after SSL_CTX_load_verify_locations() We report our own errors here. Make sure these don't clog up the error queue. --- ext/openssl/xp_ssl.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.40.0