mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Enable sslmode for PostgreSQL connections
By default, PHP 5.5 and PostgreSQL PDO will not allow SSL connections. This adds the default of "allow", but also the user may override the setting to "require" or any of the other potential values. See: http://php.net/manual/en/function.pg-connect.php
This commit is contained in:
parent
54ee34af1f
commit
ffb7e86641
1 changed files with 2 additions and 1 deletions
|
@ -46,6 +46,7 @@ class Postgres extends DboSource {
|
||||||
'schema' => 'public',
|
'schema' => 'public',
|
||||||
'port' => 5432,
|
'port' => 5432,
|
||||||
'encoding' => '',
|
'encoding' => '',
|
||||||
|
'sslmode' => 'allow',
|
||||||
'flags' => array()
|
'flags' => array()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -118,7 +119,7 @@ class Postgres extends DboSource {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->_connection = new PDO(
|
$this->_connection = new PDO(
|
||||||
"pgsql:host={$config['host']};port={$config['port']};dbname={$config['database']}",
|
"pgsql:host={$config['host']};port={$config['port']};dbname={$config['database']};sslmode={$config['sslmode']}",
|
||||||
$config['login'],
|
$config['login'],
|
||||||
$config['password'],
|
$config['password'],
|
||||||
$flags
|
$flags
|
||||||
|
|
Loading…
Add table
Reference in a new issue