MySQL over SSL

Signed-off-by: Felix <felix.nz@hotmail.de>
This commit is contained in:
Felix
2020-06-08 16:34:49 +02:00
parent 5ee566f9b5
commit 204c5c5f0b
7 changed files with 53 additions and 3 deletions

View File

@@ -145,9 +145,19 @@ class DataQuery
"password" => $this->properties[DB::PASSWORD],
"user" => $this->properties[DB::USERNAME],
"dbname" => $this->properties[DB::DATABASE],
"tablePrefix" => ""
"tablePrefix" => "",
"driverOptions" => array()
);
if ($this->properties[DB::DRIVER] == 'mysql') {
if ($this->properties[DB::SSL_CA])
$parameters["driverOptions"][\PDO::MYSQL_ATTR_SSL_CA] = \OC::$SERVERROOT.'/'.$this->properties[DB::SSL_CA];
if ($this->properties[DB::SSL_CERT])
$parameters["driverOptions"][\PDO::MYSQL_ATTR_SSL_CERT] = \OC::$SERVERROOT.'/'.$this->properties[DB::SSL_CERT];
if ($this->properties[DB::SSL_KEY])
$parameters["driverOptions"][\PDO::MYSQL_ATTR_SSL_KEY] = \OC::$SERVERROOT.'/'.$this->properties[DB::SSL_KEY];
}
$this->connection = $connectionFactory->getConnection(
$this->properties[DB::DRIVER], $parameters
);