noxxi / p5-io-socket-ssl

IO::Socket::SSL Perl Module
36 stars 59 forks source link

t/auto_verify_hostname.t hangs if URI is not present. #61

Closed toddr closed 7 years ago

toddr commented 7 years ago

Our RPM suite is hanging building IO::Socket::SSL if URI is not installed.

Based on the requirements from Makefile.PL, only these rpms need to be present to run the test suite for IO::Socket::SSL.

cpanel-perl-526-5.26.0-1.cp1170.x86_64.rpm cpanel-perl-526-Mozilla-CA-20170227-1.cp1170.noarch.rpm cpanel-perl-526-Net-SSLeay-1.81-1.cp1170.x86_64.rpm

However Until I hadd URI as a dep, the test suite hangs while running t/auto_verify_hostname.t.

Is this a known issue?

noxxi commented 7 years ago

This is not a known issue and I cannot reproduce it. I just tried on a minimal Debian with no URI module. The only place where URI is used is in IO::Socket::SSL::PublicSuffix. But, it is only optionally used there and existence is checked when loading the module. Since IO::Socket::SSL::PublicSuffix is always included in IO::Socket::SSL problems when checking for the existence of URI should affect all tests instead of only a single one.

There will be a problem if URI or other IDNA handling modules are not installed but the hostname to check has special characters which require conversion to IDNA syntax (i.e. something like "müller.de"). But, none of the tests in t/auto_verify_hostname.t requires IDNA.

To debug the problem further, could you please run the failing test standalone and with verbose output, i.e. perl -Mblib t/auto_verify_hostname.t and paste the output here?

toddr commented 7 years ago

Let me get you more details. thanks

toddr commented 7 years ago

It is entirely possible that this is my build environment. I worked around it by adding URI later. This happened and then it hung indefinitely.

[root@rpmbuild-64-centos-7 IO-Socket-SSL-2.049]# /usr/local/cpanel/3rdparty/perl/526/bin/perl -Mblib t/auto_verify_hostname.t 
1..30
ok 1 - Server Initialization
ok 2 - connection to example.com/www failed
ok 3 - connection to server.local/ldap succeeded
ok 4 - received hallo
ok 5 - connection to server.local/www failed
not ok 6 - Can't locate URI/_idna.pm in @INC (you may need to install the URI::_idna module) (@INC contains: /root/rpmbuild/BUILD/IO-Socket-SSL-2.049/blib/arch /root/rpmbuild/BUILD/IO-Socket-SSL-2.049/blib/lib /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0 /opt/cpanel/perl5/526/site_lib/x86_64-linux-64int /opt/cpanel/perl5/526/site_lib) at /root/rpmbuild/BUILD/IO-Socket-SSL-2.049/blib/lib/IO/Socket/SSL/PublicSuffix.pm line 124.
# 
#   Failed test 'Can't locate URI/_idna.pm in @INC (you may need to install the URI::_idna module) (@INC contains: /root/rpmbuild/BUILD/IO-Socket-SSL-2.049/blib/arch /root/rpmbuild/BUILD/IO-Socket-SSL-2.049/blib/lib /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0 /opt/cpanel/perl5/526/site_lib/x86_64-linux-64int /opt/cpanel/perl5/526/site_lib) at /root/rpmbuild/BUILD/IO-Socket-SSL-2.049/blib/lib/IO/Socket/SSL/PublicSuffix.pm line 124.
# '
#   at ./t/testlib.pl line 39.
toddr commented 7 years ago

As best I can tell it's one of the patches we apply to IO::Socket::SSL which is triggering a hard load of URI. This module is actually one of our most heavily patched modules. We took out all the conditional loads. Since we control the environment, the optional loads make no sense in our environment. We just choose the right thing and take everything else out.

Arguably under perl 5.26, much of the logic is moot.

I'm going to close it unless you want to understand more. Happy to share the patches with you also if you prefer. Let me know.

Thanks, Todd