Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / libwww-perl / libwww-perl-5.813 / lib / Net / HTTPS.pm
1 package Net::HTTPS;
2
3 use strict;
4 use vars qw($VERSION $SSL_SOCKET_CLASS @ISA);
5
6 $VERSION = "5.810";
7
8 # Figure out which SSL implementation to use
9 if ($Net::SSL::VERSION) {
10     $SSL_SOCKET_CLASS = "Net::SSL";
11 }
12 elsif ($IO::Socket::SSL::VERSION) {
13     $SSL_SOCKET_CLASS = "IO::Socket::SSL"; # it was already loaded
14 }
15 else {
16     eval { require Net::SSL; };     # from Crypt-SSLeay
17     if ($@) {
18         my $old_errsv = $@;
19         eval {
20             require IO::Socket::SSL;
21         };
22         if ($@) {
23             $old_errsv =~ s/\s\(\@INC contains:.*\)/)/g;
24             die $old_errsv . $@;
25         }
26         $SSL_SOCKET_CLASS = "IO::Socket::SSL";
27     }
28     else {
29         $SSL_SOCKET_CLASS = "Net::SSL";
30     }
31 }
32
33 require Net::HTTP::Methods;
34
35 @ISA=($SSL_SOCKET_CLASS, 'Net::HTTP::Methods');
36
37 sub configure {
38     my($self, $cnf) = @_;
39     $self->http_configure($cnf);
40 }
41
42 sub http_connect {
43     my($self, $cnf) = @_;
44     $self->SUPER::configure($cnf);
45 }
46
47 sub http_default_port {
48     443;
49 }
50
51 # The underlying SSLeay classes fails to work if the socket is
52 # placed in non-blocking mode.  This override of the blocking
53 # method makes sure it stays the way it was created.
54 sub blocking { }  # noop
55
56 1;