From bedd1b759b3bcaa471bffc97391d8c04cdcbd550 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 27 Nov 2023 07:26:28 +0000 Subject: t/nntpd-tls: avoid test failure on OpenBSD 7.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The LibreSSL 3.7.2 on my OpenBSD 7.3 VM seems return 7 bytes of junk data before EOF/ECONNRESET when a client attempts to write plain-text to a TLS socket. Tested-by: Štěpán Němec --- t/nntpd-tls.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t index a11a0dd9..a16cc015 100644 --- a/t/nntpd-tls.t +++ b/t/nntpd-tls.t @@ -187,8 +187,12 @@ for my $args ( my $s = tcp_connect($nntps); syswrite($s, '->accept_SSL_ will fail on this!'); - ok(!sysread($s, my $rbuf, 128), 'EOF or ECONNRESET on ->accept_SSL fail'); - + my @r; + do { # some platforms or OpenSSL versions need an extra read + push @r, sysread($s, my $rbuf, 128); + } while ($r[-1] && @r < 2); + ok(!$r[-1], 'EOF or ECONNRESET on ->accept_SSL fail') or + diag explain(\@r); $c = undef; $td->kill; $td->join; -- cgit v1.2.3-24-ge0c7