diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index b8d4f3e29..bb58f17f7 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -226,6 +226,21 @@ private function configureDbalDriverNode(ArrayNodeDefinition $node) 'If the file exists, the server\'s certificate will be verified to be signed by one of these authorities.' ) ->end() + ->scalarNode('sslcert') + ->info( + 'The path to the SSL client certificate file for PostgreSQL.' + ) + ->end() + ->scalarNode('sslkey') + ->info( + 'The path to the SSL client key file for PostgreSQL.' + ) + ->end() + ->scalarNode('sslcrl') + ->info( + 'The file name of the SSL certificate revocation list for PostgreSQL.' + ) + ->end() ->booleanNode('pooled')->info('True to use a pooled server with the oci8/pdo_oracle driver')->end() ->booleanNode('MultipleActiveResultSets')->info('Configuring MultipleActiveResultSets for the pdo_sqlsrv driver')->end() ->booleanNode('use_savepoints')->info('Use savepoints for nested transactions')->end() diff --git a/Resources/config/schema/doctrine-1.0.xsd b/Resources/config/schema/doctrine-1.0.xsd index c19ecba8a..52e1ae52e 100644 --- a/Resources/config/schema/doctrine-1.0.xsd +++ b/Resources/config/schema/doctrine-1.0.xsd @@ -61,6 +61,9 @@ + + + diff --git a/Resources/doc/configuration.rst b/Resources/doc/configuration.rst index 7ad6d35c2..f18437763 100644 --- a/Resources/doc/configuration.rst +++ b/Resources/doc/configuration.rst @@ -67,6 +67,18 @@ Configuration Reference # If the file exists, the server's certificate will be verified to be signed by one of these authorities. sslrootcert: ~ + # PostgreSQL specific (LIBPQ-CONNECT-SSLCERT). + # The name of a file containing the client SSL certificate. + sslcert: ~ + + # PostgreSQL specific (LIBPQ-CONNECT-SSLKEY). + # The name of a file containing the private key for the client SSL certificate. + sslkey: ~ + + # PostgreSQL specific (LIBPQ-CONNECT-SSLCRL). + # The name of a file containing the SSL certificate revocation list (CRL). + sslcrl: ~ + # Oracle specific (SERVER=POOLED). True to use a pooled server with the oci8/pdo_oracle driver pooled: ~ @@ -157,6 +169,18 @@ Configuration Reference # If the file exists, the server's certificate will be verified to be signed by one of these authorities. sslrootcert: ~ + # PostgreSQL specific (LIBPQ-CONNECT-SSLCERT). + # The name of a file containing the client SSL certificate. + sslcert: ~ + + # PostgreSQL specific (LIBPQ-CONNECT-SSLKEY). + # The name of a file containing the private key for the client SSL certificate. + sslkey: ~ + + # PostgreSQL specific (LIBPQ-CONNECT-SSLCRL). + # The name of a file containing the SSL certificate revocation list (CRL). + sslcrl: ~ + # Oracle specific (SERVER=POOLED). True to use a pooled server with the oci8/pdo_oracle driver pooled: ~ @@ -205,6 +229,18 @@ Configuration Reference # If the file exists, the server's certificate will be verified to be signed by one of these authorities. sslrootcert: ~ + # PostgreSQL specific (LIBPQ-CONNECT-SSLCERT). + # The name of a file containing the client SSL certificate. + sslcert: ~ + + # PostgreSQL specific (LIBPQ-CONNECT-SSLKEY). + # The name of a file containing the private key for the client SSL certificate. + sslkey: ~ + + # PostgreSQL specific (LIBPQ-CONNECT-SSLCRL). + # The name of a file containing the SSL certificate revocation list (CRL). + sslcrl: ~ + # Oracle specific (SERVER=POOLED). True to use a pooled server with the oci8/pdo_oracle driver pooled: ~ @@ -401,6 +437,9 @@ Configuration Reference + + + @@ -423,6 +462,9 @@ Configuration Reference server="" sslmode="" sslrootcert="" + sslcert="" + sslkey="" + sslcrl="" pooled="" MultipleActiveResultSets="" use-savepoints="true" @@ -461,6 +503,9 @@ Configuration Reference + + + @@ -497,6 +545,9 @@ Configuration Reference + + + @@ -898,6 +952,9 @@ can configure. The following block shows all possible configuration keys: sessionMode: 2 # oci8 driver specific (session_mode) sslmode: require # PostgreSQL specific (LIBPQ-CONNECT-SSLMODE) sslrootcert: postgresql-ca.pem # PostgreSQL specific (LIBPQ-CONNECT-SSLROOTCERT) + sslcert: postgresql-cert.pem # PostgreSQL specific (LIBPQ-CONNECT-SSLCERT) + sslkey: postgresql-key.pem # PostgreSQL specific (LIBPQ-CONNECT-SSLKEY) + sslcrl: postgresql.crl # PostgreSQL specific (LIBPQ-CONNECT-SSLCRL) wrapper_class: MyDoctrineDbalConnectionWrapper charset: UTF8 logging: "%kernel.debug%" @@ -944,6 +1001,9 @@ can configure. The following block shows all possible configuration keys: sessionMode"2" sslmode="require" sslrootcert="postgresql-ca.pem" + sslcert="postgresql-cert.pem" + sslkey="postgresql-key.pem" + sslcrl="postgresql.crl" wrapper-class="MyDoctrineDbalConnectionWrapper" charset="UTF8" logging="%kernel.debug%" diff --git a/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php b/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php index bb2477ffe..fac03b354 100644 --- a/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php +++ b/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php @@ -68,6 +68,9 @@ public function testDbalLoadFromXmlMultipleConnections() $this->assertSame('pgsql_s3cr3t', $config['password']); $this->assertSame('require', $config['sslmode']); $this->assertSame('postgresql-ca.pem', $config['sslrootcert']); + $this->assertSame('postgresql-cert.pem', $config['sslcert']); + $this->assertSame('postgresql-key.pem', $config['sslkey']); + $this->assertSame('postgresql.crl', $config['sslcrl']); $this->assertSame('utf8', $config['charset']); // doctrine.dbal.sqlanywhere_connection diff --git a/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml b/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml index e0c47e08c..21afc3823 100644 --- a/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml +++ b/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml @@ -47,6 +47,9 @@ password="pgsql_s3cr3t" sslmode="require" sslrootcert="postgresql-ca.pem" + sslcert="postgresql-cert.pem" + sslkey="postgresql-key.pem" + sslcrl="postgresql.crl" charset="utf8" />