Subject: | REST::Client breaks IO::Socket::SSL->VERSION |
Date: | Wed, 02 Apr 2014 11:32:39 -0400 |
To: | bug-REST-Client [...] rt.cpan.org |
From: | "Lance A. Brown" <lance [...] bearcircle.net> |
REST::Client version 271 breaks checking the version of IO::Socket::SSL
using IO::Socket::SSL->VERSION();
Reproducible example:
use REST::Client;
my $rest = REST::Client->new( { host => "https://google.com/" });
$rest->GET("/");
print "is defined\n" if defined($INC{'IO/Socket/SSL.pm'});
print IO::Socket::SSL->VERSION(1.42), "\n";
Output:
$ perl test.pl
is defined
IO::Socket::SSL does not define $IO::Socket::SSL::VERSION--version check
failed at test.pl line 10.
This patch fixes the problem:
--- Client.pm-stock 2014-04-02 11:31:18.828232891 -0400
+++ Client.pm 2014-04-02 11:31:35.419636716 -0400
@@ -330,6 +330,7 @@
$url = $self->_prepareURL($url);
#to ensure we use our desired SSL lib
+ require IO::Socket::SSL;
my $tmp_socket_ssl_version = $IO::Socket::SSL::VERSION;
$IO::Socket::SSL::VERSION = undef;