about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-24 00:22:26 +0000
committerEric Wong <e@80x24.org>2019-11-24 21:34:49 +0000
commit32976017fbbfdaa7ef68d85ddfe58f4cf90746c4 (patch)
treed8c6150b916eba85d935edb294824144b04b4f29 /t
parent64f3a6aded930c82e35a466b2dad58299d29ee6e (diff)
downloadpublic-inbox-32976017fbbfdaa7ef68d85ddfe58f4cf90746c4.tar.gz
It seems caching can happen within OpenSSL or negotiation
can be delayed in some cases.  In any case, don't barf on
PublicInbox::TLS::epollbit() when connect_SSL succeeds
unexpectedly.
Diffstat (limited to 't')
-rw-r--r--t/nntpd-tls.t10
1 files changed, 8 insertions, 2 deletions
diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t
index 0b6afcef..4e71e82d 100644
--- a/t/nntpd-tls.t
+++ b/t/nntpd-tls.t
@@ -120,8 +120,14 @@ for my $args (
         my $slow = tcp_connect($nntps, Blocking => 0);
         $slow = IO::Socket::SSL->start_SSL($slow, SSL_startHandshake => 0, %o);
         my $slow_done = $slow->connect_SSL;
-        diag('W: connect_SSL early OK, slow client test invalid') if $slow_done;
-        my @poll = (fileno($slow), PublicInbox::TLS::epollbit());
+        my @poll;
+        if ($slow_done) {
+                diag('W: connect_SSL early OK, slow client test invalid');
+                use PublicInbox::Syscall qw(EPOLLIN EPOLLOUT);
+                @poll = (fileno($slow), EPOLLIN | EPOLLOUT);
+        } else {
+                @poll = (fileno($slow), PublicInbox::TLS::epollbit());
+        }
         # we should call connect_SSL much later...
 
         # NNTPS