3

I was reading this question and this article.

'your_connection' => array(
  'driver'  => 'mysql',
  'host'    => $host,
  'database'  => $database,
  'username'  => $username,
  'password'  => $password,
  'charset'   => 'utf8',
  'collation' => 'utf8_unicode_ci',
  'prefix'  => '',
  'options' => array(
    PDO::MYSQL_ATTR_SSL_KEY => $cert_base . '/client-key.pem',
    PDO::MYSQL_ATTR_SSL_CERT => $cert_base . '/client-cert.pem',
    PDO::MYSQL_ATTR_SSL_CA => $cert_base . '/ca-cert.pem'
  ),
),

From what I understand, PDO::MYSQL_ATTR_SSL_CA, is can be downloaded from here

I am not sure PDO::MYSQL_ATTR_SSL_KEY and PDO::MYSQL_ATTR_SSL_CERT

I read something like this

openssl genrsa 2048 > ca-key.pem
openssl req -sha1 -new -x509 -nodes -days 3650 -key ca-key.pem > ca-cert.pem

It seems that is what I need to do, could anyone confirm?

1 Answer 1

10

To connect to AWS RDS via SSL in Laravel you only need to do a few things.

Download the rds-combined-ca-bundle.pem file from:

https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

Then place it in your configuration like this:

'options' => array(    
    PDO::MYSQL_ATTR_SSL_CA => $cert_base . '/rds-combined-ca-bundle.pem'
 ),

It doesn't require the other two keys to connect.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.