perl5-dbi / DBD-MariaDB

Perl MariaDB driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

De-initializing DBI DR structure de-initialize OpenSSL library

janchochol opened this issue · comments

Since 50da6b0 (released in 1.10) non-embedded version of DBD::MariaDB calls mysql_server_end.
mysql_server_end by default de-initialize OpenSSL (in vio_end function), this unfortunately confuse other libraries using OpenSSL (like SSleay used for HTTPS), which does not expect it.

Problem is known in MySQL under https://jira.mariadb.org/browse/MDEV-6671.
Please set mariadb_deinitialize_ssl to 0 (or make it configurable), so OpenSSL is not de-initialized.

Reproducer (using OpenSSL 1.0.2k):

use warnings;
use strict;

use LWP::UserAgent;
use DBI;
use IO::Socket::SSL;

my $ua;
my $res;
my $m;

$ua = LWP::UserAgent->new();
$res = $ua->get("https://www.google.com");

$m = DBI->connect('DBI:MariaDB:database=test;host=localhost', 'user', 'password');
$m = undef;

$res = $ua->get("https://www.google.com");

print($res->content);
print($IO::Socket::SSL::SSL_ERROR);
$ perl m.pl
Can't connect to www.google.com:443

SSL Context init failed error:140A90F1:lib(20):func(169):reason(241)