in reply to DBI:mysql connection over SSL fails
G'day Andre_C10002,
Welcome to the monastery.
I'm not in a postion to test this, but one problem may be all the embedded spaces and newlines in your DSN. Try writing it more like this:
my $dbh = DBI->connect(join('', 'DBI:mysql:database=_DATABASE_;host=_HOST_;', qw{ mysql_ssl=1; mysql_ssl_client_key=/etc/mysql/certs/client-key.pem; mysql_ssl_client_cert=/etc/mysql/certs/client-cert.pem; mysql_ssl_ca_file=/etc/mysql/certs/ca-cert.pem } ), '_SSL_USER_', '_SSL_USER_PWD_' ) || die DBI->errstr;
Another potential issue is what you really have for the placeholders you show (e.g. '_SSL_USER_PWD_'). If any of those are (or evaluate to) strings with special characters (e.g. "pass$word"), you may need to escape the special characters. There's several ways of doing this depending how you're actually getting that data into connect(). Some examples: "pass\$word", 'pass$word', q{pass$word}, "\Q$variable_holding_password\E".
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBI:mysql connection over SSL fails
by Andre_C10002 (Initiate) on May 09, 2014 at 13:57 UTC | |
by kcott (Archbishop) on May 10, 2014 at 00:26 UTC | |
by Andre_C10002 (Initiate) on May 13, 2014 at 18:46 UTC | |
|
Re^2: DBI:mysql connection over SSL fails
by Anonymous Monk on Jan 15, 2016 at 20:27 UTC | |
|
Re^2: DBI:mysql connection over SSL fails
by Anonymous Monk on Oct 02, 2014 at 21:02 UTC |