Skip Menu |

This queue is for tickets about the IO-Socket-SSL CPAN distribution.

Report information
The Basics
Id: 101485
Status: resolved
Priority: 0/
Queue: IO-Socket-SSL

People
Owner: Nobody in particular
Requestors: TEAM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.008
Fixed in: (no value)



Subject: t/protocol_version.t update for openssl 1.0.2+
Hi there, Thanks for the very rapid release on the ALPN support! This ticket is somewhat-related, fixes an issue I get with openssl1.0.2 installed and this patch applied to Net::SSLeay: https://rt.cpan.org/Ticket/Display.html?id=101484 The t/protocol_versions.t test can fail due to ->connect immediately returning false and setting $OPENSSL_ERROR. The test itself was fine apart from this. Tested with that Net::SSLeay patch+openssl 1.0.2, and on clean upstream version with 1.0.1. cheers, Tom
Subject: io-socket-ssl-protocol-version.diff
diff --git a/t/protocol_version.t b/t/protocol_version.t index 399521d..046b8be 100644 --- a/t/protocol_version.t +++ b/t/protocol_version.t @@ -31,12 +31,25 @@ if ($pid == 0) { my $check = sub { my ($ver,$expect) = @_; $XDEBUG && diag("try $ver, expect $expect"); + # Hoping that this isn't necessary, but just in case we get a TCP + # failure rather than SSL failure, wiping the previous value here + # seems like it might be a useful precaution: + $SSL_ERROR = ''; + my $cl = IO::Socket::SSL->new( PeerAddr => $saddr, SSL_startHandshake => 0, SSL_verify_mode => 0, SSL_version => $ver, - ) or die "TCP connection failed to server: $!"; + ) or do { + # Might bail out before the starttls if we provide a known-unsupported + # version, for example SSLv3 on openssl 1.0.2+ + if($SSL_ERROR =~ /$ver not supported/) { + $XDEBUG && diag("SSL connect failed with $ver: $SSL_ERROR"); + return; + } + die "TCP connection failed to server: $! (SSL error: $SSL_ERROR)"; + }; $XDEBUG && diag("TCP connected"); print $cl "starttls $ver $expect\n"; <$cl>;
Show quoted text
> Thanks for the very rapid release on the ALPN support! This ticket is > somewhat-related, fixes an issue I get with openssl1.0.2 installed and > this patch applied to Net::SSLeay:
I've included this patch too. It's not a new release but available at https://github.com/noxxi/p5-io-socket-ssl. Many thanks, Steffen