Skip to content

Commit e41e356

Browse files
committed
Test that invalid ssl option combinations are checked
1 parent 8bec278 commit e41e356

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ t/90utf8_params.t
8686
t/91errcheck.t
8787
t/92ssl_connection.t
8888
t/92ssl_optional.t
89+
t/92ssl_options.t
8990
t/92ssl_backronym_vulnerability.t
9091
t/92ssl_riddle_vulnerability.t
9192
t/93net_ssleay.t

t/92ssl_options.t

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use strict;
2+
use warnings;
3+
4+
use Test::More;
5+
use DBI;
6+
7+
use vars qw($test_dsn $test_user $test_password);
8+
use lib 't', '.';
9+
require "lib.pl";
10+
11+
plan tests => 1;
12+
13+
my $dbh = DBI->connect($test_dsn, $test_user, $test_password, { PrintError => 0, RaiseError => 0, mariadb_ssl => 0, mariadb_ssl_verify_server_cert => 1 });
14+
ok(! defined $dbh && $DBI::errstr =~ /but SSL encryption was not enabled/,
15+
'DBD::MariaDB cannot use other ssl options if ssl is not enabled'
16+
) or diag(defined $dbh ? 'Connection succeeded' : "Unexpected error: $DBI::errstr");

0 commit comments

Comments
 (0)