[packages/php] - Add PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT

arekm arekm at pld-linux.org
Fri Mar 10 09:30:56 CET 2017


commit a79b360031d68db8587e3b27dfae9f100b1443a8
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Mar 10 09:30:48 2017 +0100

    - Add PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT

 php-pdo-ssl.patch | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 php.spec          |  2 ++
 2 files changed, 71 insertions(+)
---
diff --git a/php.spec b/php.spec
index 6028c1d..a29b2df 100644
--- 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
 
diff --git a/php-pdo-ssl.patch b/php-pdo-ssl.patch
new file mode 100644
index 0000000..b573281
--- /dev/null
+++ b/php-pdo-ssl.patch
@@ -0,0 +1,69 @@
+commit 247ce052cd0fc7d0d8ea1a0e7ea2075e9601766a
+Author: Thomas Orozco <thomas at 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()) {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/a79b360031d68db8587e3b27dfae9f100b1443a8



More information about the pld-cvs-commit mailing list