1 ; obey default context options
2 ; https://bugs.php.net/bug.php?id=68344
3 diff -urbB php-5.6.12/ext/mysqlnd/mysqlnd_net.c php-5.6.12/ext/mysqlnd/mysqlnd_net.c
4 --- php-5.6.12/ext/mysqlnd/mysqlnd_net.c 2015-08-06 09:55:57.000000000 +0200
5 +++ php-5.6.12/ext/mysqlnd/mysqlnd_net.c 2015-08-10 13:25:30.187912101 +0200
7 #include "mysqlnd_ext_plugin.h"
8 #include "php_network.h"
10 +#include "ext/standard/file.h"
11 #ifdef MYSQLND_COMPRESSION_ENABLED
14 @@ -868,6 +868,21 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(
18 + if (FG(default_context)) {
19 + zval **tmpzval = NULL;
21 + /* copy values from default stream settings */
22 + char *opts[] = { "allow_self_signed", "cafile", "capath", "ciphers", "CN_match",
23 + "disable_compression", "local_cert", "local_pk", "no_ticket", "passphrase",
24 + "peer_fingerprint", "peer_name", "SNI_enabled", "SNI_server_certs", "SNI_server_name",
25 + "verify_depth", "verify_peer", "verify_peer_name", NULL };
27 + if (php_stream_context_get_option(FG(default_context), "ssl", opts[i], &tmpzval) == SUCCESS)
28 + php_stream_context_set_option(context, "ssl", opts[i], *tmpzval);
33 if (net->data->options.ssl_key) {
35 ZVAL_STRING(&key_zval, net->data->options.ssl_key, 0);