"Fossies" - the Fresh Open Source Software Archive

Member "memcached-1.6.15/t/ssl_verify_modes.t" (21 Feb 2022, 532 Bytes) of package /linux/www/memcached-1.6.15.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/perl
    2 
    3 use strict;
    4 use warnings;
    5 use Test::More;
    6 use FindBin qw($Bin);
    7 use lib "$Bin/lib";
    8 use MemcachedTest;
    9 use Cwd;
   10 
   11 if (!enabled_tls_testing()) {
   12     plan skip_all => 'SSL testing is not enabled';
   13     exit 0;
   14 }
   15 
   16 my $ca_crt = getcwd() . "/t/" . MemcachedTest::CA_CRT;
   17 my $server = new_memcached("-o ssl_verify_mode=2 -o ssl_ca_cert=$ca_crt");
   18 # just using stats to make sure everything is working fine.
   19 my $stats = mem_stats($server->sock);
   20 is($stats->{accepting_conns}, 1, "client cert is verified");
   21 
   22 done_testing();