Subject: | [PATCH] Protocol/https10.pm, Net/HTTPS.pm: when both IO::Socket::SSL and Net::SSL are loaded, use the latter |
Date: | Sun, 8 Apr 2007 00:31:26 +0400 |
To: | bug-libwww-perl [...] rt.cpan.org |
From: | Alexey Tourbin <at [...] altlinux.ru> |
---
lib/LWP/Protocol/https10.pm | 5 ++++-
lib/Net/HTTPS.pm | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/LWP/Protocol/https10.pm b/lib/LWP/Protocol/https10.pm
index 4a92be6..f367904 100644
--- a/lib/LWP/Protocol/https10.pm
+++ b/lib/LWP/Protocol/https10.pm
@@ -7,7 +7,10 @@ package LWP::Protocol::https10;
# Figure out which SSL implementation to use
use vars qw($SSL_CLASS);
-if ($IO::Socket::SSL::VERSION) {
+if ($Net::SSL::VERSION) {
+ $SSL_SOCKET_CLASS = "Net::SSL";
+}
+elsif ($IO::Socket::SSL::VERSION) {
$SSL_CLASS = "IO::Socket::SSL"; # it was already loaded
}
else {
diff --git a/lib/Net/HTTPS.pm b/lib/Net/HTTPS.pm
index b722ac1..cef29ca 100644
--- a/lib/Net/HTTPS.pm
+++ b/lib/Net/HTTPS.pm
@@ -8,7 +8,10 @@ use vars qw($VERSION $SSL_SOCKET_CLASS @ISA);
$VERSION = "1.00";
# Figure out which SSL implementation to use
-if ($IO::Socket::SSL::VERSION) {
+if ($Net::SSL::VERSION) {
+ $SSL_SOCKET_CLASS = "Net::SSL";
+}
+elsif ($IO::Socket::SSL::VERSION) {
$SSL_SOCKET_CLASS = "IO::Socket::SSL"; # it was already loaded
}
else {
--
1.5.1.GIT