« blib/lib/Monitoring/Sneck/Checks/fail2ban.pm
↑ Summary
blib/lib/Monitoring/Sneck/Checks/mailq.pm »
| 1 | package Monitoring::Sneck::Checks::tls_protocols; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 4 | ▶ | use 5.014; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 4 | ▶ | use parent 'Monitoring::Sneck::Checks::base'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | Monitoring::Sneck::Checks::tls_protocols - checks what TLS versions a server takes | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | =head1 VERSION | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | Version 0.0.1 | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | =cut | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 4 | our $VERSION = '0.0.1'; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | # The versions, by the names IO::Socket::SSL takes, and how they are said. | ||||||||||||||||||||||||||||
| 21 | 4 | our @VERSIONS = ( | |||||||||||||||||||||||||||
| 22 | [ 'SSLv3', 'SSLv3' ], | ||||||||||||||||||||||||||||
| 23 | [ 'TLSv1', 'TLSv1.0' ], | ||||||||||||||||||||||||||||
| 24 | [ 'TLSv1_1', 'TLSv1.1' ], | ||||||||||||||||||||||||||||
| 25 | [ 'TLSv1_2', 'TLSv1.2' ], | ||||||||||||||||||||||||||||
| 26 | [ 'TLSv1_3', 'TLSv1.3' ] | ||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||
| 28 | 4 | our %SAID = map { $_->[0] => $_->[1] } @VERSIONS; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | www_tls|perl:tls_protocols -H www.example.org | ||||||||||||||||||||||||||||
| 33 | mail_tls|perl:tls_protocols -H mail.example.org -s smtp -a TLSv1_2 -a TLSv1_3 | ||||||||||||||||||||||||||||
| 34 | ldaps_tls|perl:tls_protocols -H ldap.example.org -p 636 -r TLSv1 -r TLSv1_1 -r SSLv3 | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | Tries each TLS version given on its own, through L<IO::Socket::SSL>. A | ||||||||||||||||||||||||||||
| 39 | version in --refuse that the server takes, or one in --accept that it | ||||||||||||||||||||||||||||
| 40 | does not, is CRITICAL. | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | Every version is tried with OpenSSL's security level set to 0, as | ||||||||||||||||||||||||||||
| 43 | otherwise this side would refuse the old ones, not the server. A version this | ||||||||||||||||||||||||||||
| 44 | host's OpenSSL can not do at all, as is common for SSLv3, is UNKNOWN, | ||||||||||||||||||||||||||||
| 45 | as it can not be told if the server takes it. So is not being able | ||||||||||||||||||||||||||||
| 46 | to connect, or STARTTLS failing, as nothing could be tried. | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | The certificate is not checked, see L<Monitoring::Sneck::Checks::https_cert> | ||||||||||||||||||||||||||||
| 49 | for that. --starttls works the same as there. | ||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | =head1 OPTIONS | ||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | - -H, --hostname :: The host. Required. | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | - -p, --port :: The port. | ||||||||||||||||||||||||||||
| 56 | Default :: 443, or for --starttls, the protocol's | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | - -n, --sni :: The name to ask for. | ||||||||||||||||||||||||||||
| 59 | Default :: --hostname | ||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | - -s, --starttls :: Ask for TLS through smtp, imap, pop3, ftp, or ldap. | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | - --helo-name :: The name to give in EHLO, for --starttls smtp. | ||||||||||||||||||||||||||||
| 64 | Default :: the host name of this host | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | - -r, --refuse :: A version it must not take, SSLv3, TLSv1, TLSv1_1, | ||||||||||||||||||||||||||||
| 67 | TLSv1_2, or TLSv1_3. May be given more than once. | ||||||||||||||||||||||||||||
| 68 | Default :: TLSv1 and TLSv1_1, unless --accept is given | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | - -a, --accept :: A version it must take. May be given more than once. | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | =cut | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | 10 | ▶ | sub option_spec { | ||||||||||||||||||||||||||
|
Subroutine
option_spec: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 75 | 10 | return ( 'hostname|H=s', 'port|p=i', 'sni|n=s', 'starttls|s=s', 'helo-name=s', 'refuse|r=s@', 'accept|a=s@' ); | |||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | 10 | ▶ | sub required { return ('hostname') } | ||||||||||||||||||||||||||
|
Subroutine
required: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 10 | ▶ | sub validate { | ||||||||||||||||||||||||||
|
Subroutine
validate: called CC=10 SCAR=23.1
Pod
documented
| |||||||||||||||||||||||||||||
| 81 | 10 | my ( $self, $options ) = @_; | |||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 10 | require Monitoring::Sneck::Checks::https_cert; | |||||||||||||||||||||||||||
| 84 | 10 | my @problems; | |||||||||||||||||||||||||||
| 85 | 10 | foreach my $name ( 'hostname', 'sni', 'helo-name' ) { | |||||||||||||||||||||||||||
| 86 | push( @problems, '--' . $name . ' "' . $options->{$name} . '" is not a IP or hostname' ) | ||||||||||||||||||||||||||||
| 87 | 30 | ▶ | if defined( $options->{$name} ) && !$self->is_host( $options->{$name} ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $options->{$name} and not $self->is_host($options->{$name})
MC/DC0%0/2
defined $options->{$name} and not $self->is_host($options->{$name})
defined $options->{$name}
not $self->is_host($options->{$name})
Truth table66%2/3
A and not(B)
A= defined $options->{$name}B= not $self->is_host($options->{$name})
| |||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||
| 89 | 10 | foreach my $name ( 'refuse', 'accept' ) { | |||||||||||||||||||||||||||
| 90 | 20 | ▶ | foreach my $version ( @{ $options->{$name} // [] } ) { | ||||||||||||||||||||||||||
|
Condition100%2/2
$options->{$name} // []
MC/DC100%1/1
$options->{$name} // []
$options->{$name}
Truth table100%2/2
A
A= $options->{$name}
| |||||||||||||||||||||||||||||
| 91 | 5 | push( @problems, '--' . $name . ' "' . $version . '" must be ' . join( ', ', map { $_->[0] } @VERSIONS ) ) | |||||||||||||||||||||||||||
| 92 | 9 | ▶ | if !$SAID{$version}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | push( @problems, | ||||||||||||||||||||||||||||
| 96 | '--starttls must be ' . join( ', ', sort( keys(%Monitoring::Sneck::Checks::https_cert::STARTTLS_PORTS) ) ) ) | ||||||||||||||||||||||||||||
| 97 | if defined( $options->{starttls} ) | ||||||||||||||||||||||||||||
| 98 | 10 | ▶ | && !$Monitoring::Sneck::Checks::https_cert::STARTTLS_PORTS{ $options->{starttls} }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $options->{"starttls"} and not $Monitoring::Sneck::Checks::https_cert::STARTTLS_PORTS{$options->{"starttls"}}
MC/DC100%2/2
defined $options->{"starttls"} and not $Monitoring::Sneck::Checks::https_cert::STARTTLS_PORTS{$options->{"starttls"}}
defined $options->{"starttls"}
not $Monitoring::Sneck::Checks::https_cert::STARTTLS_PORTS{$options->{"starttls"}}
Truth table100%3/3
A and not(B)
A= defined $options->{"starttls"}B= not $Monitoring::Sneck::Checks::https_cert::STARTTLS_PORTS{$options->{"starttls"}}
| |||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | 10 | return @problems; | |||||||||||||||||||||||||||
| 101 | } ## end sub validate | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | =head1 METHODS | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | =head2 check | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | Does the check. | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | =cut | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | 8 | ▶ | sub check { | ||||||||||||||||||||||||||
|
Subroutine
check: called CC=20 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||
| 112 | 8 | my ($self) = @_; | |||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | 8 | ▶ | my @refuse = @{ $self->opt('refuse') // ( defined( $self->opt('accept') ) ? [] : [ 'TLSv1', 'TLSv1_1' ] ) }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$self->opt("refuse") // (defined $self->opt("accept") ? [] : ["TLSv1", "TLSv1_1"])
MC/DC100%1/1
$self->opt("refuse") // (defined $self->opt("accept") ? [] : ["TLSv1", "TLSv1_1"])
$self->opt("refuse")
Truth table100%2/2
A
A= $self->opt("refuse")
| |||||||||||||||||||||||||||||
| 115 | 8 | ▶ | my @accept = @{ $self->opt('accept') // [] }; | ||||||||||||||||||||||||||
|
Condition100%2/2
$self->opt("accept") // []
MC/DC100%1/1
$self->opt("accept") // []
$self->opt("accept")
Truth table100%2/2
A
A= $self->opt("accept")
| |||||||||||||||||||||||||||||
| 116 | 8 | my ( @taken, @refused, @should_refuse, @should_take, @untried ); | |||||||||||||||||||||||||||
| 117 | 8 | foreach my $version ( map { $_->[0] } @VERSIONS ) { | |||||||||||||||||||||||||||
| 118 | 40 | ▶ | next if !grep { $_ eq $version } @refuse, @accept; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 119 | 14 | my ( $taken, $why ) = $self->try($version); | |||||||||||||||||||||||||||
| 120 | 14 | ▶ | if ( !defined($taken) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 121 | 3 | push( @untried, $SAID{$version} . ', ' . $why ); | |||||||||||||||||||||||||||
| 122 | 3 | next; | |||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||
| 124 | 11 | ▶ | push( @{ $taken ? \@taken : \@refused }, $SAID{$version} ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 125 | 11 | ▶ | push( @should_refuse, $SAID{$version} ) if $taken && grep { $_ eq $version } @refuse; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$taken and grep {$_ eq $version;} @refuse
MC/DC100%2/2
$taken and grep {$_ eq $version;} @refuse
$taken
grep {$_ eq $version;} @refuse
Truth table100%3/3
A and B
A= $takenB= grep {$_ eq $version;} @refuse
| |||||||||||||||||||||||||||||
| 126 | 11 | ▶ | push( @should_take, $SAID{$version} ) if !$taken && grep { $_ eq $version } @accept; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not $taken and grep {$_ eq $version;} @accept
MC/DC100%2/2
not $taken and grep {$_ eq $version;} @accept
not $taken
grep {$_ eq $version;} @accept
Truth table100%3/3
not(A) and B
A= not $takenB= grep {$_ eq $version;} @accept
| |||||||||||||||||||||||||||||
| 127 | } ## end foreach my $version ( map { $_->[0] } @VERSIONS) | ||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | 8 | my @codes = ( $self->OK ); | |||||||||||||||||||||||||||
| 130 | 8 | ▶ | push( @codes, $self->CRITICAL ) if defined( $should_refuse[0] ) || defined( $should_take[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $should_refuse[0] or defined $should_take[0]
MC/DC100%2/2
defined $should_refuse[0] or defined $should_take[0]
defined $should_refuse[0]
defined $should_take[0]
Truth table100%3/3
A or B
A= defined $should_refuse[0]B= defined $should_take[0]
| |||||||||||||||||||||||||||||
| 131 | 8 | ▶ | push( @codes, $self->UNKNOWN ) if defined( $untried[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 132 | 8 | my @parts; | |||||||||||||||||||||||||||
| 133 | 8 | ▶ | push( @parts, 'takes ' . join( ', ', @taken ) ) if defined( $taken[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 134 | 8 | ▶ | push( @parts, 'refuses ' . join( ', ', @refused ) ) if defined( $refused[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 135 | 8 | ▶ | push( @parts, 'should refuse ' . join( ', ', @should_refuse ) ) if defined( $should_refuse[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 136 | 8 | ▶ | push( @parts, 'should take ' . join( ', ', @should_take ) ) if defined( $should_take[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 137 | 8 | ▶ | push( @parts, 'could not try ' . join( '; ', @untried ) ) if defined( $untried[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | 8 | return $self->finish( $self->worst(@codes), | |||||||||||||||||||||||||||
| 140 | $self->opt('hostname') . ':' . $self->port . ' ' . join( ', ', @parts ) ); | ||||||||||||||||||||||||||||
| 141 | } ## end sub check | ||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | =head2 port | ||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | Returns the port, --port, or the default for --starttls, or 443. | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | =cut | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | 22 | ▶ | sub port { | ||||||||||||||||||||||||||
|
Subroutine
port: called CC=3 SCAR=16.5
Pod
documented
| |||||||||||||||||||||||||||||
| 150 | 22 | my ($self) = @_; | |||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||
| 152 | 22 | ▶ | return $self->opt('port') if defined( $self->opt('port') ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 153 | 0 | ▶ | return $Monitoring::Sneck::Checks::https_cert::STARTTLS_PORTS{ $self->opt('starttls') } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 154 | if defined( $self->opt('starttls') ); | ||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | 0 | return 443; | |||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | =head2 try | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | Tries a version. | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | Returns 1 if the server takes it, 0 and why if not, or undef and why if | ||||||||||||||||||||||||||||
| 164 | it could not be tried, as for this host's OpenSSL not doing it, or not | ||||||||||||||||||||||||||||
| 165 | being able to connect at all. | ||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | =cut | ||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | 14 | ▶ | sub try { | ||||||||||||||||||||||||||
|
Subroutine
try: called CC=10 SCAR=24.0
Pod
documented
| |||||||||||||||||||||||||||||
| 170 | 14 | my ( $self, $version ) = @_; | |||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||
| 172 | 14 | require IO::Socket::SSL; | |||||||||||||||||||||||||||
| 173 | 14 | require IO::Socket::IP; | |||||||||||||||||||||||||||
| 174 | 14 | require Data::Validate::IP; | |||||||||||||||||||||||||||
| 175 | 14 | ▶ | my $name = $self->opt('sni') // $self->opt('hostname'); | ||||||||||||||||||||||||||
|
Condition33%1/3
$self->opt("sni") // $self->opt("hostname")
MC/DC0%0/2
$self->opt("sni") // $self->opt("hostname")
$self->opt("sni")
$self->opt("hostname")
Truth table33%1/3
A // B
A= $self->opt("sni")B= $self->opt("hostname")
| |||||||||||||||||||||||||||||
| 176 | 14 | ▶ | my %ssl = ( | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 177 | SSL_version => $version, | ||||||||||||||||||||||||||||
| 178 | SSL_verify_mode => 0, | ||||||||||||||||||||||||||||
| 179 | SSL_cipher_list => 'ALL:@SECLEVEL=0', | ||||||||||||||||||||||||||||
| 180 | SSL_hostname => Data::Validate::IP::is_ip($name) ? '' : $name, | ||||||||||||||||||||||||||||
| 181 | Timeout => $self->timeout, | ||||||||||||||||||||||||||||
| 182 | ); | ||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||
| 184 | 14 | my $plain = IO::Socket::IP->new( | |||||||||||||||||||||||||||
| 185 | PeerHost => $self->opt('hostname'), | ||||||||||||||||||||||||||||
| 186 | PeerPort => $self->port, | ||||||||||||||||||||||||||||
| 187 | Proto => 'tcp', | ||||||||||||||||||||||||||||
| 188 | Timeout => $self->timeout | ||||||||||||||||||||||||||||
| 189 | ); | ||||||||||||||||||||||||||||
| 190 | 14 | ▶ | return ( undef, 'can not connect, ' . ( $@ || $! ) ) if !$plain; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$@ || $!
MC/DC0%0/2
$@ || $!
$@
$!
Truth table33%1/3
A || B
A= $@B= $!
| |||||||||||||||||||||||||||||
| 191 | 12 | ▶ | if ( defined( $self->opt('starttls') ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 192 | 1 | $plain->autoflush(1); | |||||||||||||||||||||||||||
| 193 | 1 | my $problem = Monitoring::Sneck::Checks::https_cert::starttls( $self, $plain, $self->opt('starttls') ); | |||||||||||||||||||||||||||
| 194 | 1 | ▶ | if ( defined($problem) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 195 | 0 | close($plain); | |||||||||||||||||||||||||||
| 196 | 0 | return ( undef, $self->opt('starttls') . ' ' . $problem ); | |||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||
| 199 | 12 | my $socket = IO::Socket::SSL->start_SSL( $plain, %ssl ); | |||||||||||||||||||||||||||
| 200 | 12 | ▶ | if ($socket) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 201 | 6 | close($socket); | |||||||||||||||||||||||||||
| 202 | 6 | return (1); | |||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||
| 204 | 6 | ▶ | my $why = IO::Socket::SSL::errstr() // 'unknown error'; | ||||||||||||||||||||||||||
|
Condition50%1/2
IO::Socket::SSL::errstr() // "unknown error"
MC/DC0%0/1
IO::Socket::SSL::errstr() // "unknown error"
IO::Socket::SSL::errstr()
Truth table50%1/2
A
A= IO::Socket::SSL::errstr()
| |||||||||||||||||||||||||||||
| 205 | 6 | close($plain); | |||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||
| 207 | # this side not being able to do it at all, not the server saying no | ||||||||||||||||||||||||||||
| 208 | 6 | ▶ | return ( undef, 'this host can not do it, ' . $why ) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 209 | if $why | ||||||||||||||||||||||||||||
| 210 | =~ /no protocols available|null ssl method|unknown option|invalid SSL_version|SSL Version \S+ not supported/i; | ||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||
| 212 | 5 | return ( 0, $why ); | |||||||||||||||||||||||||||
| 213 | } ## end sub try | ||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||
| 215 | 4 | 1; | |||||||||||||||||||||||||||