home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _8c04c6a9d985e662be23816d97068019 < prev    next >
Encoding:
Text File  |  2004-06-01  |  1.1 KB  |  56 lines

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