Skip to content

Commit f20d7a5

Browse files
committed
Make it possible to disable Common Name (CN) verification of the servers certificate.
1 parent 20a1778 commit f20d7a5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config.dist.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,5 @@
7070
$config['db']['ssl_cert'] = '/path/to/cert.crt'; // path to an SSL certificate file. Only makes sense combined with ssl_key
7171
$config['db']['ssl_ca'] = '/path/to/ca.crt'; // path to a file containing SSL CA certs
7272
$config['db']['ssl_capath'] = '/path/to/ca_certs'; // path to a directory containing CA certs
73-
$config['db']['ssl_cipher'] = '/DHE-RSA-AES256-SHA:AES128-SHA'; // one or more SSL Ciphers
73+
$config['db']['ssl_cipher'] = 'DHE-RSA-AES256-SHA:AES128-SHA'; // one or more SSL Ciphers
74+
$config['db']['ssl_verify'] = true; // Verify Common Name (CN) of server certificate?

functions/classes/class.PDO.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,10 @@ private function set_db_params () {
905905

906906
$this->ssl = array();
907907

908+
if ($config['db']['ssl_verify']===false) {
909+
$this->ssl[PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT] = false;
910+
}
911+
908912
foreach ($this->pdo_ssl_opts as $key => $pdoopt) {
909913
if ($config['db'][$key]) {
910914
$this->ssl[$pdoopt] = $config['db'][$key];
@@ -1011,4 +1015,4 @@ public function getForeignKeyInfo() {
10111015

10121016
return array($foreignLinksByTable, $foreignLinksByRefTable);
10131017
}
1014-
}
1018+
}

0 commit comments

Comments
 (0)