yxes has asked for the wisdom of the Perl Monks concerning the following question:
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 :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: AWS RDS MySQL SSL
by hotchiwawa (Scribe) on Jan 02, 2016 at 18:29 UTC | |
by yxes (Acolyte) on Jan 02, 2016 at 19:50 UTC | |
by hotchiwawa (Scribe) on Jan 02, 2016 at 19:53 UTC | |
|
Re: AWS RDS MySQL SSL
by Chefboyardei (Initiate) on Sep 29, 2016 at 15:51 UTC | |
by yxes (Acolyte) on Dec 13, 2019 at 00:53 UTC | |
by hippo (Archbishop) on Dec 13, 2019 at 10:59 UTC |