ddrazin has asked for the wisdom of the Perl Monks concerning the following question:
Only CA file is used for connection to database, X509 CA cert and X509 CA key are not required.I’m trying to connect using following command:mysql -h database_host -u username --password=password --ssl-ca= /path +_to_CA_file/ca-cert.pem
And I have SSL connection error 2026my $dbhost = "database_host"; my $dbuser = "username"; my $dbpw = "password"; my $cafile = "/path_to_CA_file/ca-cert.pem"; #my $key = undef; #my $cert = undef; my $dbname = "dbname"; my $dbtable = "dbtable"; my $dbh = DBI->connect("DBI:mysql:database=$dbname;host=$dbhost;mysql_ +ssl=1;mysql_ssl_ca_file=$cafile","$dbuser", "$dbpw",{'RaiseError' => +1}) or die "Error in connecting to database";
-> DBI->connect(DBI:mysql:database=dbname;host=database_host;mysql +_ssl=1;mysql_ssl_ca_file=/path_to_CA_file/ca-cert.pem, username, **** +, HASH(0x7c9080)) -> DBI->install_driver(mysql) for linux perl=5.022000 pid=20099 ru +id=83598 euid=83598 install_driver: DBD::mysql version 4.041 loaded from /app/vbuil +d/SLED11-x86_64/perl/5.22-addons-secure_mysql/x86_64-linux-thread-mul +ti/DBD/mysql.pm New 'DBI::dr' (for DBD::mysql::dr, parent='', id=undef) dbih_setup_handle(DBI::dr=HASH(0x10c5738)=>DBI::dr=HASH(0x10bbe80) +, DBD::mysql::dr, 0, Null!) dbih_make_com(Null!, 0, DBD::mysql::dr, 152, 0) thr#7c6010 dbih_setup_attrib(DBI::dr=HASH(0x10bbe80), Err, Null!) SCALAR(0xf9 +a938) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x10bbe80), State, Null!) SCALAR(0x +adc370) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x10bbe80), Errstr, Null!) SCALAR(0 +xfab6c8) (already defined) dbih_setup_attrib(DBI::dr=HASH(0x10bbe80), TraceLevel, Null!) 0 (a +lready defined) dbih_setup_attrib(DBI::dr=HASH(0x10bbe80), FetchHashKeyName, Null! +) 'NAME' (already defined) install_method DBI::db::mysql_fd install_method DBI::db::mysql_async_result install_method DBI::db::mysql_async_ready install_method DBI::st::mysql_async_result install_method DBI::st::mysql_async_ready <- install_driver= DBI::dr=HASH(0x10c5738) >> connect DISPATCH (DBI::dr=HASH(0x10c5738) rc2/3 @5 g2 ima80 +01 pid#20099) at /app/vbuild/SLED11-x86_64/perl/5.22-addons-secure_my +sql/x86_64-linux-thread-multi/DBI.pm line 684 !! The warn '0' was CLEARED by call to connect method -> connect for DBD::mysql::dr (DBI::dr=HASH(0x10c5738)~0x10bbe80 ' +database=dbname;host=database_host;mysql_ssl=1;mysql_ssl_ca_file=/pat +h_to_CA_file/ca-cert.pem' 'username' **** HASH(0xa63c98)) thr#7c6010 New 'DBI::db' (for DBD::mysql::db, parent=DBI::dr=HASH(0x10bbe80), + id=HASH(0x10ce280)) dbih_setup_handle(DBI::db=HASH(0x10ce5e0)=>DBI::db=HASH(0x10ce370) +, DBD::mysql::db, adc628, HASH(0x10ce280)) dbih_make_com(DBI::dr=HASH(0x10bbe80), 1012500, DBD::mysql::db, 19 +2, 10ce298) thr#7c6010 dbih_setup_attrib(DBI::db=HASH(0x10ce370), Err, DBI::dr=HASH(0x10b +be80)) SCALAR(0xadc850) (already defined) dbih_setup_attrib(DBI::db=HASH(0x10ce370), State, DBI::dr=HASH(0x1 +0bbe80)) SCALAR(0xadc8b0) (already defined) dbih_setup_attrib(DBI::db=HASH(0x10ce370), Errstr, DBI::dr=HASH(0x +10bbe80)) SCALAR(0xadc880) (already defined) dbih_setup_attrib(DBI::db=HASH(0x10ce370), TraceLevel, DBI::dr=HAS +H(0x10bbe80)) 0 (already defined) dbih_setup_attrib(DBI::db=HASH(0x10ce370), FetchHashKeyName, DBI:: +dr=HASH(0x10bbe80)) 'NAME' (already defined) dbih_setup_attrib(DBI::db=HASH(0x10ce370), HandleSetErr, DBI::dr=H +ASH(0x10bbe80)) undef (not defined) dbih_setup_attrib(DBI::db=HASH(0x10ce370), HandleError, DBI::dr=HA +SH(0x10bbe80)) undef (not defined) dbih_setup_attrib(DBI::db=HASH(0x10ce370), ReadOnly, DBI::dr=HASH( +0x10bbe80)) undef (not defined) dbih_setup_attrib(DBI::db=HASH(0x10ce370), Profile, DBI::dr=HASH(0 +x10bbe80)) undef (not defined) imp_dbh->connect: dsn = database=dbname;host=database_host;mysql_ssl=1 +;mysql_ssl_ca_file=/path_to_CA_file/ca-cert.pem, uid = username, pwd += password imp_dbh->my_login : dbname = dbname, uid = username, pwd = password,ho +st = database_host, port = NULL imp_dbh->mysql_dr_connect: host = |database_host|, port = 0, uid = use +rname, pwd = password imp_dbh->bind_type_guessing: 0 imp_dbh->use_server_side_prepare: 0 imp_dbh->disable_fallback_for_server_prepare: 0 imp_dbh->mysql_dr_connect: client_flags = 2050 imp_dbh->mysql_dr_connect: <- --> do_error SSL connection error error 2026 recorded: SSL connection error <-- do_error
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI problem connecting MYSQL using secure connection
by hippo (Archbishop) on Jan 13, 2017 at 13:13 UTC | |
|
Re: DBI problem connecting MYSQL using secure connection
by soonix (Chancellor) on Jan 14, 2017 at 11:31 UTC |