File: ssl_verify_modes.t

package info (click to toggle)
memcached 1.6.39-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,320 kB
  • sloc: ansic: 62,281; perl: 12,500; sh: 4,569; makefile: 468; python: 402; xml: 59
file content (22 lines) | stat: -rw-r--r-- 536 bytes parent folder | download | duplicates (3)
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();