From 8fd41797b24736dfdccfacc5acc473234a29758a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 16 Jun 2020 22:31:20 +0000 Subject: daemon: use ->can to check for IO::Socket::SSL Doing a ref($obj) string comparison ties us to IO::Socket::SSL (and OpenSSL) In the future, we may support GnuTLS or other TLS implementations. This was already done in the IMAP code. --- lib/PublicInbox/HTTP.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/HTTP.pm') diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index b73ce2d7..6ccf2059 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -59,7 +59,7 @@ sub new ($$$) { my $self = fields::new($class); my $ev = EPOLLIN; my $wbuf; - if (ref($sock) eq 'IO::Socket::SSL' && !$sock->accept_SSL) { + if ($sock->can('accept_SSL') && !$sock->accept_SSL) { return CORE::close($sock) if $! != EAGAIN; $ev = PublicInbox::TLS::epollbit(); $wbuf = [ \&PublicInbox::DS::accept_tls_step ]; -- cgit v1.2.3-24-ge0c7