]> git.pld-linux.org Git - packages/php.git/blame - php-mysql-ssl-context.patch
Merge 4:5.3.28-7, 4:5.6.4-2 triggers for rpm 4.16
[packages/php.git] / php-mysql-ssl-context.patch
CommitLineData
18d0d716
AM
1; obey default context options
2; https://bugs.php.net/bug.php?id=68344
3diff -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
6@@ -29,6 +29,7 @@
7 #include "mysqlnd_ext_plugin.h"
8 #include "php_network.h"
9 #include "zend_ini.h"
10+#include "ext/standard/file.h"
11 #ifdef MYSQLND_COMPRESSION_ENABLED
12 #include <zlib.h>
13 #endif
14@@ -868,6 +868,21 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(
15 DBG_RETURN(FAIL);
16 }
17
18+ if (FG(default_context)) {
19+ zval **tmpzval = NULL;
20+ int i = 0;
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 };
26+ while (opts[i]) {
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);
29+ i++;
30+ }
31+ }
32+
33 if (net->data->options.ssl_key) {
34 zval key_zval;
35 ZVAL_STRING(&key_zval, net->data->options.ssl_key, 0);
36
This page took 0.028538 seconds and 4 git commands to generate.