Desired Outcome: establish an SSL connection to Amazon's RDS system using MySQL.

Here's the docs according to Amazon.

http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html

After creating a user that requires SSL with the above instructions, I can easily connect using the command line:

mysql -u myuser -p -h myhost.us-east-1.rds.amazonaws.com --ssl-ca=cert/rds-combined-ca-bundle.pem --ssl-verify-server-cert

I just want to point out that I'm NOT using SSL to authenticate. Just to establish a secure link and verify the server, hence the need to enter my user/pass.

use DBI; my $dbh = DBI->connect( "DBI:mysql:Test:myhost.us-east-1.rds.amazonaws.com:3306;mysql_ssl=1 +", "myuser","****") || die DBI->errstr; $dbh->disconnect;

The relevant docs for DBD::mysql are located here: DBD::mysql#mysql_ssll

Considering that I'm not authenticating, I thought maybe I could get away with just setting mysql_ssl=1 and according to this post:

http://forums.mysql.com/read.php?38,520999,525084

that should be all I need (but it's using a language I will not mention here).

when that returned

Access denied for user 'myuser'@'xx.x.x.xxx'

I tried various combinations of:

DBI:mysql:Test:myhost.us-east-1.rds.amazonaws.com:3306;mysql_ssl=1;mysql_ssl_ca_file=./cert/rds-combined-ca-bundle.pem

and

DBI:mysql:Test:myhost.us-east-1.rds.amazonaws.com:3306;mysql_ssl=1;mysql_ssl_ca_file=rds-combined-ca-bundle.pem;mysql_ssl_ca_path=./cert/

to no avail even after changing the settings to use full paths instead of relative ones.

Turning off SSL for myuser on MySQL and removing mysql_ssl=1 from the DBI connection works perfectly, but I'm stumped as to why I'm unable to connect with SSL. Advice has run the gamut from using Expect with mysql-client to writing a proxy server in some other language to forgetting about SSL completely...

Has anyone had luck with using DBI and connecting to MySQL on Amazon's RDS via SSL? If so, I beg of you to impart your vast wisdom in the ways of the... TIA :)


In reply to AWS RDS MySQL SSL by yxes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.