Subject: | IO::Socket::SSL is throwing IPv6 related warning when used with perl 5.14.0 |
Date: | Sun, 14 Apr 2013 06:04:26 +0000 |
To: | "bug-IO-Socket-SSL [...] rt.cpan.org" <bug-IO-Socket-SSL [...] rt.cpan.org> |
From: | "Tekriwal, Prashant" <Prashant.Tekriwal [...] netapp.com> |
Hi,
First of all I would like to thank the author for contributing to the open source world so that people like us can leverage author's work. I really appreciate it.
This email is to report a bug that we found recently when running some of our tests that were importing IO::Socket::SSL with perl 5.14.0.
The issue is that on importing IO::Socket::SSL, with 'inet6' support, in our test scripts we are getting following warning:
IPv6 support re-enabled in __PACKAGE__, got disabled in file line at /usr/perl-5.14.0/lib/site_perl/5.14.0/IO/Socket/SSL.pm line 180.
I checked SSL.pm code and found out that if package IO::Socket::IP is available (i.e. installed) we will get the above warning else not.
[user@rhel5]$ perl5.14.0 -e 'use IO::Socket::SSL qw(inet6)'
[user@rhel5]$
In the above example module 'IO::Socket::IP' is not installed under our standard perl lib location, so perl didn't find IO::Socket::IP and hence no warning.
We installed IO:::Socket::IP in a temp location, and included it in perl's path during execution:
[user@rhel5]$ perl5.14.0 -I /usr//perl5.14_temp/lib/perl5/ -e 'use IO::Socket::SSL qw(inet6)'
IPv6 support re-enabled in __PACKAGE__, got disabled in file line at /usr/software/perl-implementation/perl-5.14.0/lib/site_perl/5.14.0/IO/Socket/SSL.pm line 180.
[user@rhel5]$
Now we got this warning.
I then dig more in the SSL.pm code and found that in the second BEGIN block, the code is checking for IPv6 support and inside the 'if ( $ip6) ' block it is checking if IO::Socket::IP is available
then inherit from it and then call import else inherit from IO::Socket::INET6 (if available) and call import.
But in the 'import' subroutine, it checks if SSL.pm has inherited from IO::Socket::INET6 or not only, and throws warning if it has not.
Clearly if IO::Socket::IP is present SSL.pm will inherit from it and the 'import' function will always throw the warning, which is the case we are hitting.
The issue is that we are moving from using perl 5.8.8 to perl 5.14.0 and this warning does not come with perl 5.8.8. So when running tests with perl 5.14.0 users are seeing this extra warning and getting alarmed.
This is a kind request to the author of the module 'IO::Socket::SSL' to have it corrected and also advise us on if there is something we can do at our end to avoid this warning till the new version is released.
Here are some other details that the author might be interested in:
Perl Version : 5.14.0
Distribution Name/Version : IO::Socket::SSL v1.76 or greater
OS/Architecture : Redhat Enterprise Linux 5.3 or greater
Below code change (in 'import' subroutine) will make this warning disappear:
sub import {
.
.
foreach (@_) {
if( /^inet4$) {
.
.
} elsif ( /^inet6$/i ) {
@caller_force_inet4 = caller();
# check if we have already ipv6 as base
if ( CAN_IPV6 && ! UNIVERSAL::isa( $class, CAN_IPV6 )) {
# either we don't support it or we disabled it by explicitly
# loading it with 'inet4'. In this case re-enable but warn
# because this is probably an error
if ( CAN_IPV6 ) {
@ISA = ( CAN_IPV6 );
warn "IPv6 support re-enabled in __PACKAGE__, got disabled in file $caller_force_inet4[1] line $caller_force_inet4[2]";
} else {
die "INET6 is not supported, install IO::Socket::INET6";
}
} elsif ( ! CAN_IPV6 ) {
die "IPv6 is not supported, install IO::Socket::IP or IO::Socket::INET6";
}
} elsif ( /^:?debug(\d+)/ ) {
$DEBUG=$1;
} else {
push @export,$_
}
}
.
.
}
Do let me know if you need any additional information and also if the above patch is fine or not.
In the end, I will once again would like to appreciate the work you are doing by contribution to open source community.
Thanks and Regards,
Prashant