2

The context for my question: forcing Pdo_Mysql driver for Magento to use SSL connection to an Amazon AWS RDS instance. The database user is set to use only SSL connection.

In order to use SSL connection, PDO::MYSQL_ATTR_SSL_CA must point to the public certificate in the client.

If I define the property manually in the Zend_Db_Adapter_Abstract, then I get the following array :

Array
(
    [use] => 
    [host] => *.rds.amazonaws.com
    [username] => user
    [password] => pass
    [dbname] => magento
    [initStatements] => SET NAMES utf8
    [model] => mysql4
    [type] => pdo_mysql
    [active] => 1
    [charset] => 
    [persistent] => 
    [options] => Array
        (
            [caseFolding] => 0
            [autoQuoteIdentifiers] => 1
            [fetchMode] => 2
        )

    [driver_options] => Array
        (
            [1012] => /path/to/amazon/cert/mysql-ssl-ca-cert.pem
        )

    [port] => 3306
)

Since most of the fields in the above array match the 'connection' node in the local.xml config file, I should be able to define 'driver_options' as follows:

<driver_options>
   <1012>/path/to/amazon/cert/mysq.pem</1012>
</diver_options>

Of course this is invalid and using variations of 'PDO::MYSQL_ATTR_SSL_CA' instead of 1012 isn't useful either. Has anybody managed to set this value either through XML or otherwise? I am trying to avoid rewriting any of the lib/Varien classes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.