Skip to content

Commit 54df4c7

Browse files
committed
Updates related to fixing SSL connections
1 parent 17b06e8 commit 54df4c7

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Zebra_Database.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Read more {@link https://github.com/stefangabos/Zebra_Database here}
1111
*
1212
* @author Stefan Gabos <contact@stefangabos.ro>
13-
* @version 2.13.0 (last revision: August 22, 2025)
13+
* @version 2.13.0 (last revision: August 27, 2025)
1414
* @copyright © 2006 - 2025 Stefan Gabos
1515
* @license https://www.gnu.org/licenses/lgpl-3.0.txt GNU LESSER GENERAL PUBLIC LICENSE
1616
* @package Zebra_Database
@@ -4638,20 +4638,20 @@ private function _connected() {
46384638
// configure SSL if SSL options are provided
46394639
if (is_array($this->ssl_options)) {
46404640

4641+
// handle SSL verification option if provided
4642+
if (isset($this->ssl_options['verify'])) {
4643+
$this->connection->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, $this->ssl_options['verify']);
4644+
}
4645+
46414646
// set SSL options using provided parameters
46424647
mysqli_ssl_set($this->connection,
46434648
isset($this->ssl_options['key']) ? $this->ssl_options['key'] : null,
46444649
isset($this->ssl_options['cert']) ? $this->ssl_options['cert'] : null,
4645-
isset($this->ssl_options['ca']) ? $this->ssl_options['ca'] : null,
4650+
isset($this->ssl_options['ca']) && !(isset($this->ssl_options['verify']) && $this->ssl_options['verify'] === false) ? $this->ssl_options['ca'] : null,
46464651
isset($this->ssl_options['capath']) ? $this->ssl_options['capath'] : null,
46474652
isset($this->ssl_options['cipher']) ? $this->ssl_options['cipher'] : null
46484653
);
46494654

4650-
// handle SSL verification option if provided
4651-
if (isset($this->ssl_options['verify'])) {
4652-
$this->connection->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, $this->ssl_options['verify']);
4653-
}
4654-
46554655
}
46564656

46574657
// try to connect to the MySQL server

0 commit comments

Comments
 (0)