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:
Stephen Cuppett 2014-11-15 15:10:55 -05:00 committed by mark_story
parent 54ee34af1f
commit ffb7e86641

View file

@ -46,6 +46,7 @@ class Postgres extends DboSource {
'schema' => 'public',
'port' => 5432,
'encoding' => '',
'sslmode' => 'allow',
'flags' => array()
);
@ -118,7 +119,7 @@ class Postgres extends DboSource {
try {
$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['password'],
$flags