summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-06-03 15:14:01 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-06-03 15:14:01 +0200
commitac60007becc7943d1da95ec0f9f92c6a3325ec72 (patch)
treeb69ea6fe0600b8995e6db95e6df3a516514dd0a0
parent2e025794745e09f7d0c72822ad0238bf6d67b2e8 (diff)
downloadphp-git-ac60007becc7943d1da95ec0f9f92c6a3325ec72.tar.gz
Clear errors after SSL_CTX_load_verify_locations()
We report our own errors here. Make sure these don't clog up the error queue.
-rw-r--r--ext/openssl/xp_ssl.c1
1 files changed, 1 insertions, 0 deletions
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;
}