]> granicus.if.org Git - php/commitdiff
Clear errors after SSL_CTX_load_verify_locations()
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 3 Jun 2019 13:14:01 +0000 (15:14 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 3 Jun 2019 13:14:01 +0000 (15:14 +0200)
We report our own errors here. Make sure these don't clog up the
error queue.

ext/openssl/xp_ssl.c

index 9e481c6376574254b894fddec48839966d695896..56e53487319c562710e5ba6312f748614ec324d7 100644 (file)
@@ -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;
                        }