]> git.pld-linux.org Git - packages/php.git/commitdiff
- Add PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 10 Mar 2017 08:30:48 +0000 (09:30 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 10 Mar 2017 08:30:48 +0000 (09:30 +0100)
php-pdo-ssl.patch [new file with mode: 0644]
php.spec

diff --git a/php-pdo-ssl.patch b/php-pdo-ssl.patch
new file mode 100644 (file)
index 0000000..b573281
--- /dev/null
@@ -0,0 +1,69 @@
+commit 247ce052cd0fc7d0d8ea1a0e7ea2075e9601766a
+Author: Thomas Orozco <thomas@orozco.fr>
+Date:   Thu Jun 9 10:45:40 2016 +0200
+
+    Fixed bug #71003: Add PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT
+
+diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
+index 021ac89b45..1bf4eb039a 100644
+--- a/ext/pdo_mysql/mysql_driver.c
++++ b/ext/pdo_mysql/mysql_driver.c
+@@ -736,6 +736,18 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
+                       }
+               }
+ #endif
++
++#ifdef PDO_USE_MYSQLND
++              {
++                      zend_long ssl_verify_cert = pdo_attr_lval(driver_options,
++                                      PDO_MYSQL_ATTR_SSL_VERIFY_SERVER_CERT, -1);
++                      if (ssl_verify_cert != -1) {
++                              connect_opts |= ssl_verify_cert ?
++                                      CLIENT_SSL_VERIFY_SERVER_CERT:
++                                      CLIENT_SSL_DONT_VERIFY_SERVER_CERT;
++                      }
++              }
++#endif
+       }
+ #ifdef PDO_MYSQL_HAS_CHARSET
+diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
+index 32b85ba547..99fb6d3b77 100644
+--- a/ext/pdo_mysql/pdo_mysql.c
++++ b/ext/pdo_mysql/pdo_mysql.c
+@@ -130,6 +130,9 @@ static PHP_MINIT_FUNCTION(pdo_mysql)
+        REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SERVER_PUBLIC_KEY", (zend_long)PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY);
+ #endif
+       REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MULTI_STATEMENTS", (zend_long)PDO_MYSQL_ATTR_MULTI_STATEMENTS);
++#ifdef PDO_USE_MYSQLND
++      REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_SSL_VERIFY_SERVER_CERT", (zend_long)PDO_MYSQL_ATTR_SSL_VERIFY_SERVER_CERT);
++#endif
+ #ifdef PDO_USE_MYSQLND
+       mysqlnd_reverse_api_register_api(&pdo_mysql_reverse_api);
+diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h
+index f300e044ba..89884120ab 100644
+--- a/ext/pdo_mysql/php_pdo_mysql_int.h
++++ b/ext/pdo_mysql/php_pdo_mysql_int.h
+@@ -179,6 +179,9 @@ enum {
+       PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY,
+ #endif
+       PDO_MYSQL_ATTR_MULTI_STATEMENTS,
++#ifdef PDO_USE_MYSQLND
++      PDO_MYSQL_ATTR_SSL_VERIFY_SERVER_CERT,
++#endif
+ };
+ #endif
+diff --git a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
+index f3d0fa6313..fba1c2433e 100644
+--- a/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
++++ b/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
+@@ -27,6 +27,7 @@ if (!extension_loaded('mysqli') && !extension_loaded('mysqlnd')) {
+               "MYSQL_ATTR_SSL_CIPHER"                                         => true,
+               "MYSQL_ATTR_COMPRESS"                                           => true,
+               "MYSQL_ATTR_MULTI_STATEMENTS"                                   => true,
++              "MYSQL_ATTR_SSL_VERIFY_SERVER_CERT"                             => true,
+       );
+       if (!MySQLPDOTest::isPDOMySQLnd()) {
index 6028c1dee97605278b1e2f5c39b2422d6739f128..a29b2df4062ac6a8c98ae255025840a6f7346f40 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -222,6 +222,7 @@ Patch69:    fpm-conf-split.patch
 Patch70:       mysqlnd-ssl.patch
 Patch71:       libdb-info.patch
 Patch72:       phar-hash-shared.patch
+Patch73:       php-pdo-ssl.patch
 URL:           http://php.net/
 %{?with_interbase:%{!?with_interbase_inst:BuildRequires:       Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:  aspell-devel >= 2:0.50.0}
@@ -2037,6 +2038,7 @@ exit 1
 %patch70 -p1
 %patch71 -p1
 %patch72 -p1
+%patch73 -p1
 
 %{__sed} -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
 
This page took 0.079965 seconds and 4 git commands to generate.