about summary refs log tree commit homepage
path: root/lib/PublicInbox/HTTP.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-16 22:31:20 +0000
committerEric Wong <e@yhbt.net>2020-06-21 00:42:32 +0000
commit8fd41797b24736dfdccfacc5acc473234a29758a (patch)
tree0a6f467777653ff98a5b933f0bd8bb748c809ff2 /lib/PublicInbox/HTTP.pm
parent74c897120af8ac4cac17d9f76d21c84f903e24be (diff)
downloadpublic-inbox-8fd41797b24736dfdccfacc5acc473234a29758a.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/HTTP.pm')
-rw-r--r--lib/PublicInbox/HTTP.pm2
1 files changed, 1 insertions, 1 deletions
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 ];