Skip Menu |

This queue is for tickets about the Net-SSL-ExpireDate CPAN distribution.

Report information
The Basics
Id: 62236
Status: resolved
Priority: 0/
Queue: Net-SSL-ExpireDate

People
Owner: hirose31 [...] gmail.com
Requestors: cpan [...] grepular.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.06
Fixed in: (no value)



Subject: Please add IPv6 support. Patch supplied
Net::SSL::ExpireDate doesn't currently support IPv6. I have attached a patch which adds support by using IO::Socket::INET6, if and only if it is available. Mike
Subject: ExpireDate.patch
--- ExpireDate.pm.ORIGINAL 2010-10-18 15:26:09.000000000 +0100 +++ ExpireDate.pm 2010-10-18 15:35:32.000000000 +0100 @@ -48,6 +48,9 @@ my $SSL3_AD_CERTIFICATE_UNKNOWN = 46; my $SSL3_AD_ILLEGAL_PARAMETER = 47; # fatal +eval 'use IO::Socket::INET6'; +my $ipv6_support = $@ ? 0 : 1; + sub new { my ($class, %opt) = @_; @@ -139,7 +142,7 @@ my $cert; no warnings 'once'; - *IO::Socket::INET::write_atomically = sub { + my $sub = sub { my($self, $data) = @_; my $length = length $data; @@ -156,11 +159,19 @@ return $read_byte; }; - my $sock = IO::Socket::INET->new( + my $sock = { PeerAddr => $host, PeerPort => $port, Proto => 'tcp', - ) or croak "cannot create socket: $!"; + }; + + if( $ipv6_support ){ + *IO::Socket::INET6::write_atomically = $sub; + $sock = IO::Socket::INET6->new( %$sock ) or croak "cannot create socket: $!"; + } else { + *IO::Socket::INET::write_atomically = $sub; + $sock = IO::Socket::INET->new( %$sock ) or croak "cannot create socket: $!"; + } _send_client_hello($sock);
Thanks for your patch! I'll check and apply your patch soon. On 2010-10月-18 月 10:43:04, https://secure.grepular.com/ wrote: Show quoted text
> Net::SSL::ExpireDate doesn't currently support IPv6. I have attached a > patch which adds support by using IO::Socket::INET6, if and only if it > is available. > > Mike
fixed in 1.07