Skip to content

Commit

Permalink
mysqli: fixed SSL setup to pass empty string instead of null [closes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Oct 11, 2020
1 parent f6ef525 commit 201a4cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Drivers/Mysqli/MysqliDriver.php
Expand Up @@ -72,7 +72,7 @@ public function connect(array $params, ILogger $logger): void

if (!@$this->connection->real_connect($host, $params['username'], (string) $params['password'], $dbname, $port, $socket, $flags)) {
throw $this->createException(
$this->connection->connect_error,
$this->connection->connect_error ?? $this->connection->error, // @phpstan-ignore-line
$this->connection->connect_errno,
// @phpstan-ignore-next-line - Property access is not allowed yet
@$this->connection->sqlstate ?: 'HY000'
Expand Down Expand Up @@ -245,11 +245,11 @@ protected function setupSsl(array $params): void
}

$this->connection->ssl_set(
$params['sslKey'] ?? null,
$params['sslCert'] ?? null,
$params['sslCa'] ?? null,
$params['sslCapath'] ?? null,
$params['sslCipher'] ?? null
$params['sslKey'] ?? '',
$params['sslCert'] ?? '',
$params['sslCa'] ?? '',
$params['sslCapath'] ?? '',
$params['sslCipher'] ?? ''
);
}

Expand Down

0 comments on commit 201a4cd

Please sign in to comment.