]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/nntpd*.t: require IO::Socket::SSL 2.007 for Net::NNTP tests
authorEric Wong <e@80x24.org>
Mon, 1 Jul 2019 08:56:51 +0000 (08:56 +0000)
committerEric Wong <e@80x24.org>
Fri, 5 Jul 2019 04:03:28 +0000 (04:03 +0000)
Net::NNTP won't attempt to use older versions of IO::Socket::SSL
because 2.007 is the "first version with default CA on most platforms"
according to comments in Net::NNTP.  But then again we don't make
remote requests when testing...

t/nntpd-tls.t
t/nntpd.t

index 4cf53daad8cd0325fdb7e9555ab56bc7a19906d4..49b31221f02c6cf0ec19af788010c864ba857984 100644 (file)
@@ -13,6 +13,8 @@ foreach my $mod (qw(DBD::SQLite IO::Socket::SSL Net::NNTP IO::Poll)) {
 }
 Net::NNTP->can('starttls') or
        plan skip_all => 'Net::NNTP does not support TLS';
+IO::Socket::SSL->VERSION(2.007) or
+       plan skip_all => 'IO::Socket::SSL <2.007 not supported by Net::NNTP';
 
 my $cert = 'certs/server-cert.pem';
 my $key = 'certs/server-key.pem';
index 1c5ae8d7a5beaf0858620b7fc4d09655ba8b6624..fdb4bee42b639554d4c093ecb6a374c880d053fa 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -104,6 +104,10 @@ EOF
        SKIP: {
                $n->can('starttls') or
                        skip('Net::NNTP too old to support STARTTLS', 2);
+               eval {
+                       require IO::Socket::SSL;
+                       IO::Socket::SSL->VERSION(2.007);
+               } or skip('IO::Socket::SSL <2.007 not supported by Net::NNTP');
                ok(!$n->starttls, 'STARTTLS fails when unconfigured');
                is($n->code, 580, 'got 580 code on server w/o TLS');
        };