database - symfony2 doctrine.dbal.connection_factory with ssl? -
i connect remote database within symfony2 app code
$connectionfactory = $this->container->get('doctrine.dbal.connection_factory'); $conn = $connectionfactory->createconnection(array( 'driver' => 'pdo_mysql', 'user' => 'mattias', 'password' => 'fdfsdf', 'host' => 'fs1.rrtgy.se', 'dbname' => 'csmedia', )); return $conn;
is there parameter can set using ssl?
the equivalent of this:
$link = mysql_connect("192.112.7.18","test","testpass",false,mysql_client_ssl)
you try add createconnection array 'driveroptions'
$conn = $connectionfactory->createconnection(array( 'driver' => 'pdo_mysql', 'user' => 'mattias', 'password' => 'fdfsdf', 'host' => 'fs1.rrtgy.se', 'dbname' => 'csmedia', 'driveroptions' => array( pdo::mysql_attr_ssl_ca =>'/path/to/ssl-ca.pem' ), ));
more info mysql ssl constants.
notice, constants added @ php 5.3.7
however, ssl options silently ignored in (at least) version 5.3.8: see bug report.
Comments
Post a Comment