diff options
author | Andrey Hristov <andrey@php.net> | 2015-10-22 11:48:53 +0200 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2015-10-22 11:48:53 +0200 |
commit | afd31489d0d9999f701467e99ef2b40794eed196 (patch) | |
tree | 74cfa92c20dd0b14058ef7286bc8057c2001e971 /ext/mysqlnd/mysqlnd_net.c | |
parent | 8292260515a904b4d515484145c78f33a06ae1ae (diff) | |
download | php-git-afd31489d0d9999f701467e99ef2b40794eed196.tar.gz |
Improve fix for Bug #68344 MySQLi does not provide way to disable peer certificate validation
Diffstat (limited to 'ext/mysqlnd/mysqlnd_net.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_net.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index 4cbe9deb29..7b164ac294 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -897,14 +897,9 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC) ZVAL_STRING(&key_zval, net->data->options.ssl_key, 0); php_stream_context_set_option(context, "ssl", "local_pk", &key_zval); } - if (net->data->options.ssl_verify_peer) { - zval verify_peer_zval; - ZVAL_TRUE(&verify_peer_zval); - php_stream_context_set_option(context, "ssl", "verify_peer", &verify_peer_zval); - php_stream_context_set_option(context, "ssl", "verify_peer_name", &verify_peer_zval); - } else { + { zval verify_peer_zval; - ZVAL_FALSE(&verify_peer_zval); + ZVAL_BOOL(&verify_peer_zval, net->data->options.ssl_verify_peer); php_stream_context_set_option(context, "ssl", "verify_peer", &verify_peer_zval); php_stream_context_set_option(context, "ssl", "verify_peer_name", &verify_peer_zval); } |