Problems Securing Database Connection Over SSL I used to connect to my database over SSL by directly modifying the createDbConnection method in Craft's AppBehavior.php:

$dbConnection = new DbConnection();

$dbConnection-&gt;connectionString = $this-&gt;_processConnectionString();
$dbConnection-&gt;emulatePrepare   = true;
$dbConnection-&gt;username         = craft()-&gt;config-&gt;get('user', ConfigFile::Db);
$dbConnection-&gt;password         = craft()-&gt;config-&gt;get('password', ConfigFile::Db);
$dbConnection-&gt;charset          = craft()-&gt;config-&gt;get('charset', ConfigFile::Db);
$dbConnection-&gt;tablePrefix      = $dbConnection-&gt;getNormalizedTablePrefix();
$dbConnection-&gt;driverMap        = array('mysql' =&gt; 'Craft\MysqlSchema');

// additional attributes to connect over SSL
if (getenv('DB_SSL_ENABLED') == 'true') 
{
    $dbConnection-&gt;attributes   = array(
        PDO::MYSQL_ATTR_SSL_CIPHER =&gt; 'DHE-RSA-AES256-SHA:AES128-SHA',
        PDO::MYSQL_ATTR_SSL_CA     =&gt; CRAFT_CONFIG_PATH . 'rds-combined-ca-bundle.pem',
    );
}

$dbConnection-&gt;init();


But as of a new Craft release there is a native Craft way to do this by setting a new "attributes" key in the database config file. Unfortunately, Craft won't make a connection when I connect using this new method. I get the dreaded Craft can’t connect to the database with the credentials in craft/config/db.php error. My revised db.php looks like this:

$url = parse_url(getenv("DATABASE_URL"));

define(SERVER, $url["host"]);
define(USER, $url["user"]);
define(PASSWORD, $url["pass"]);
define(DATABASE, substr($url["path"], 1));

return array(
    'server' =&gt; SERVER,
    'user' =&gt; USER,
    'password' =&gt; PASSWORD,
    'database' =&gt; DATABASE,
    'tablePrefix' =&gt; 'craft',
    'attributes' =&gt; array(
        PDO::MYSQL_ATTR_SSL_CIPHER =&gt; 'DHE-RSA-AES256-SHA:AES128-SHA',
        PDO::MYSQL_ATTR_SSL_CA     =&gt; CRAFT_CONFIG_PATH . 'rds-combined-ca-bundle.pem',
     )
);


Not sure what could be going wrong here. Are there additional attributes that need to be set when doing this the Yii way?
Silly mistake. I forgot to update AppBehaviors.php to the newest release after moving the attributes logic to db.php:

$dbConnection = new DbConnection();

$dbConnection-&gt;connectionString = $this-&gt;_processConnectionString();
$dbConnection-&gt;emulatePrepare   = true;
$dbConnection-&gt;username         = craft()-&gt;config-&gt;get('user', ConfigFile::Db);
$dbConnection-&gt;password         = craft()-&gt;config-&gt;get('password', ConfigFile::Db);
$dbConnection-&gt;charset          = craft()-&gt;config-&gt;get('charset', ConfigFile::Db);
$dbConnection-&gt;tablePrefix      = $dbConnection-&gt;getNormalizedTablePrefix();
$dbConnection-&gt;driverMap        = array('mysql' =&gt; 'Craft\MysqlSchema');

// Support for Yii's $initSQLs
if ($initSQLs = craft()-&gt;config-&gt;get('initSQLs', ConfigFile::Db))
{
    $dbConnection-&gt;initSQLs = $initSQLs;
}
// See if we have any extra PDO attributes passed in.
if ($attributes = craft()-&gt;config-&gt;get('attributes', ConfigFile::Db))
{
    $dbConnection-&gt;attributes = $attributes;
}

$dbConnection-&gt;init();


After adding the new lines of code, I was able to connect :)