summaryrefslogtreecommitdiff
path: root/t/ssl_verify_modes.t
blob: 78b5cb9b2fe850fa7d889dd562b668847c383948 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env perl

use strict;
use warnings;
use Test::More;
use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;
use Cwd;

if (!enabled_tls_testing()) {
    plan skip_all => 'SSL testing is not enabled';
    exit 0;
}

my $ca_crt = getcwd() . "/t/" . MemcachedTest::CA_CRT;
my $server = new_memcached("-o ssl_verify_mode=2 -o ssl_ca_cert=$ca_crt");
# just using stats to make sure everything is working fine.
my $stats = mem_stats($server->sock);
is($stats->{accepting_conns}, 1, "client cert is verified");

done_testing();