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 <stepnem@smrk.net>
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;