diff options
author | Andrey Andreev <narf@devilix.net> | 2015-07-16 15:17:27 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-07-16 15:17:27 +0200 |
commit | cfc9e77c89ee5377b25e411ef3d8ab43c8900b7e (patch) | |
tree | 84eefe253951d0df09bb7d9a52289f74137b6544 /system/database/drivers/mysqli/mysqli_driver.php | |
parent | cbb70f0244b55935b61c605f3d2171489492c7db (diff) |
Add 'ssl_verify' option for mysqli driver
MYSQLI_OPT_SSL_VERIFY_SERVER_CERT is an undocumented option that may not always be available.
Reference: http://svn.php.net/viewvc/php/php-src/trunk/ext/mysqli/tests/mysqli_constants.phpt?view=markup&pathrev=302897
Diffstat (limited to 'system/database/drivers/mysqli/mysqli_driver.php')
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 8d398c866..dd3cc77c6 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -142,6 +142,11 @@ class CI_DB_mysqli_driver extends CI_DB { if ( ! empty($ssl)) { + if ( ! empty($this->encrypt['ssl_verify']) && defined('MYSQLI_OPT_SSL_VERIFY_SERVER_CERT')) + { + $mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, TRUE); + } + $client_flags |= MYSQLI_CLIENT_SSL; $mysqli->ssl_set( isset($ssl['key']) ? $ssl['key'] : NULL, |