Subject: | Wonkiness when using AnyEvent::TLS::SNI and hosts that start with a number |
Date: | Fri, 31 Jul 2015 09:37:39 -0700 |
To: | bug-AnyEvent-TLS-SNI [...] rt.cpan.org |
From: | Tim Jenkins <tim.jenkins [...] sendgrid.com> |
Hello,
Thanks for writing this module. While verifying that it would work for all
of our customer domains I found that the domain '09398c11.ngrok.io' would
generate an error:
Can't call method "AnyEvent::Socket::parse_address" without a package or
object reference at
/opt/perl/lib/site_perl/5.10.1/x86_64-linux-gnu-thread-multi/AnyEvent/TLS.pm
line 971
Digging into the code for AnyEvent::TLS it looks like this is trying to
convert a hostname to network byte order (which makes no sense to me, but
whatever :) ) and when using these hosts that start with numbers it causes
problems.
I found that adding a use AnyEvent::Socket before loading the
AnyEvent::TLS::SNI module would fix the issue, but adding it after would
not.
Would you consider adding the following patch to the module so this issue
is just resolved in the module?
--- /tmp/SNI.pm 2015-07-31 16:35:51.301835238 +0000
+++ /opt/perl/lib/site_perl/5.10.1/AnyEvent/TLS/SNI.pm 2015-07-31
16:35:28.974892628 +0000
@@ -6,6 +6,7 @@
use warnings;
no warnings 'redefine';
no strict 'refs';
+use AnyEvent::Socket;
use AnyEvent::TLS;
use Net::SSLeay;
use Carp qw( croak );
Thanks,
Tim