Last change
on this file since 27181 was 27181, checked in by davidb, 11 years ago |
Latest libwww-perl (v6x) isn't as self-sufficeint as earlier (v5.x) in terms of supporting Perl modules. Dropping back to to this earlier version so activate.pl runs smoothly when system-installed Perl on Unix system does not have the LWP and related modules installed
|
File size:
1.2 KB
|
Line | |
---|
1 | package Net::HTTPS;
|
---|
2 |
|
---|
3 | use strict;
|
---|
4 | use vars qw($VERSION $SSL_SOCKET_CLASS @ISA);
|
---|
5 |
|
---|
6 | $VERSION = "5.819";
|
---|
7 |
|
---|
8 | # Figure out which SSL implementation to use
|
---|
9 | if ($SSL_SOCKET_CLASS) {
|
---|
10 | # somebody already set it
|
---|
11 | }
|
---|
12 | elsif ($Net::SSL::VERSION) {
|
---|
13 | $SSL_SOCKET_CLASS = "Net::SSL";
|
---|
14 | }
|
---|
15 | elsif ($IO::Socket::SSL::VERSION) {
|
---|
16 | $SSL_SOCKET_CLASS = "IO::Socket::SSL"; # it was already loaded
|
---|
17 | }
|
---|
18 | else {
|
---|
19 | eval { require Net::SSL; }; # from Crypt-SSLeay
|
---|
20 | if ($@) {
|
---|
21 | my $old_errsv = $@;
|
---|
22 | eval {
|
---|
23 | require IO::Socket::SSL;
|
---|
24 | };
|
---|
25 | if ($@) {
|
---|
26 | $old_errsv =~ s/\s\(\@INC contains:.*\)/)/g;
|
---|
27 | die $old_errsv . $@;
|
---|
28 | }
|
---|
29 | $SSL_SOCKET_CLASS = "IO::Socket::SSL";
|
---|
30 | }
|
---|
31 | else {
|
---|
32 | $SSL_SOCKET_CLASS = "Net::SSL";
|
---|
33 | }
|
---|
34 | }
|
---|
35 |
|
---|
36 | require Net::HTTP::Methods;
|
---|
37 |
|
---|
38 | @ISA=($SSL_SOCKET_CLASS, 'Net::HTTP::Methods');
|
---|
39 |
|
---|
40 | sub configure {
|
---|
41 | my($self, $cnf) = @_;
|
---|
42 | $self->http_configure($cnf);
|
---|
43 | }
|
---|
44 |
|
---|
45 | sub http_connect {
|
---|
46 | my($self, $cnf) = @_;
|
---|
47 | $self->SUPER::configure($cnf);
|
---|
48 | }
|
---|
49 |
|
---|
50 | sub http_default_port {
|
---|
51 | 443;
|
---|
52 | }
|
---|
53 |
|
---|
54 | # The underlying SSLeay classes fails to work if the socket is
|
---|
55 | # placed in non-blocking mode. This override of the blocking
|
---|
56 | # method makes sure it stays the way it was created.
|
---|
57 | sub blocking { } # noop
|
---|
58 |
|
---|
59 | 1;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.