user/dev discussion of public-inbox itself
 help / color / mirror / Atom feed
From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH 1/2] testcommon: require IO::Socket::SSL >= 2.007
Date: Sat, 20 Jun 2020 00:13:01 +0000
Message-ID: <20200620001302.1150-2-e@yhbt.net> (raw)
In-Reply-To: <20200620001302.1150-1-e@yhbt.net>

Net::NNTP does not support older IO::Socket::SSL.  1.94 on
CentOS 7.x fails HTTPS and IMAPS tests, too.

cf. https://rt.cpan.org/Ticket/Display.html?id=100529
---
 lib/PublicInbox/TestCommon.pm | 10 +++++++++-
 t/nntpd-tls.t                 |  2 --
 t/nntpd.t                     |  5 -----
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index a97125e5..6bf4526a 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -95,7 +95,15 @@ sub require_mods {
 		} else {
 			eval "require $mod";
 		}
-		push @need, $mod if $@;
+		if ($@) {
+			push @need, $mod;
+		} elsif ($mod eq 'IO::Socket::SSL' &&
+			# old versions of IO::Socket::SSL aren't supported
+			# by libnet, at least:
+			# https://rt.cpan.org/Ticket/Display.html?id=100529
+				!eval{ IO::Socket::SSL->VERSION(2.007); 1 }) {
+			push @need, $@;
+		}
 	}
 	return unless @need;
 	my $m = join(', ', @need)." missing for $0";
diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t
index 3de219f1..23baf4e4 100644
--- a/t/nntpd-tls.t
+++ b/t/nntpd-tls.t
@@ -10,8 +10,6 @@ use PublicInbox::TestCommon;
 require_mods(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';
diff --git a/t/nntpd.t b/t/nntpd.t
index b24720eb..575b66fa 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -109,11 +109,6 @@ EOF
 		$n->can('starttls') or
 			skip('Net::NNTP too old to support STARTTLS', 2);
 		require_mods('IO::Socket::SSL', 2);
-		eval {
-			IO::Socket::SSL->VERSION(2.007);
-		} or skip(<<EOF, 2);
-IO::Socket::SSL <2.007 not supported by Net::NNTP
-EOF
 		ok(!$n->starttls, 'STARTTLS fails when unconfigured');
 		is($n->code, 580, 'got 580 code on server w/o TLS');
 	};

  reply	other threads:[~2020-06-20  0:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20  0:13 [PATCH 0/2] test fixes for older systems Eric Wong
2020-06-20  0:13 ` Eric Wong [this message]
2020-06-20  0:13 ` [PATCH 2/2] tests: require git 2.6+ in more places Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200620001302.1150-2-e@yhbt.net \
    --to=e@yhbt.net \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ http://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git