summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2018-08-22 14:01:20 +0200
committerAndrey Andreev <narf@devilix.net>2018-08-22 14:01:20 +0200
commitf1e13c0127d9ba2d6da722672401b92dd37780bb (patch)
treee210fed582ada064c7a89cfff7ea6ce4010f70a9
parent058102de9f4977968fe5d7359e63400d4927cf72 (diff)
[ci skip] Close #5513
-rw-r--r--application/config/database.php2
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php5
-rw-r--r--user_guide_src/source/changelog.rst4
3 files changed, 10 insertions, 1 deletions
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 <database/index> driver.
+
Bug fixes for 3.1.10
--------------------