From f1e13c0127d9ba2d6da722672401b92dd37780bb Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 22 Aug 2018 15:01:20 +0300 Subject: [ci skip] Close #5513 --- application/config/database.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php | 5 +++++ user_guide_src/source/changelog.rst | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/application/config/database.php b/application/config/database.php index d22321e2a..0088ef140 100644 --- a/application/config/database.php +++ b/application/config/database.php @@ -49,7 +49,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | 'ssl_ca' - Path to the certificate authority file | 'ssl_capath' - Path to a directory containing trusted CA certificates in PEM format | 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':') -| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only) +| 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not | | ['compress'] Whether or not to use client compression (MySQL only) | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php index e172145e9..fb0097c80 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php @@ -167,6 +167,11 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver { empty($this->encrypt['ssl_capath']) OR $ssl[PDO::MYSQL_ATTR_SSL_CAPATH] = $this->encrypt['ssl_capath']; empty($this->encrypt['ssl_cipher']) OR $ssl[PDO::MYSQL_ATTR_SSL_CIPHER] = $this->encrypt['ssl_cipher']; + if (defined('PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT') && isset($this->encrypt['ssl_verify'])) + { + $ssl[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = $this->encrypt['ssl_verify']; + } + // DO NOT use array_merge() here! // It re-indexes numeric keys and the PDO_MYSQL_ATTR_SSL_* constants are integers. empty($ssl) OR $this->options += $ssl; diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 21bca15ac..af32fe882 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -5,6 +5,10 @@ Change Log Version 3.1.10 ============== +- General Changes + + - Added 'ssl_verify' support to the 'pdo/mysql' :doc:`Database driver. + Bug fixes for 3.1.10 -------------------- -- cgit v1.2.3-24-g4f1b