Net-HTTP

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

    - set "x_static_install" : 1 in META files

6.18      2018-05-09 14:55:43Z
    - Move httpbin.org tests to author testing (GH#56) (Olaf Alders)

6.17      2017-09-01 15:30:20Z
    - Fix test which relied on cpan.org speaking plain HTTP GH#54 (Chase
      Whitener)

6.16      2017-05-29 10:46:24-04:00 America/Toronto
    - Bump IO::Socket::SSL version from 1.38 to 2.012

6.15      2017-05-12 14:57:02+02:00 Europe/Paris
    - Fix t/rt-112313.t (Shoichi Kaji)

6.14      2017-04-24 11:27:26-04:00 America/Toronto
    - Improvements to live tests (Shoichi Kaji and Kent Fredric)
    - Fix a bug where downloading files is sometimes very slow GH#44 (Shoichi
      Kaji)

6.13      2017-02-19 21:40:54-05:00 America/Toronto

Changes  view on Meta::CPAN


6.08_001    2015-05-01
    - resolve issues with SSL by reading bytes still waiting to be read after
      the initial 1024 bytes [RT#104122] (Mark Overmeer)

6.07    2014-07-23
    - Opportunistically use IO::Socket::IP or IO::Socket::INET6. (Jason Fesler)
    - Properly parse IPv6 literal addresses with optional port numbers. [RT#75618]

6.06    2013-03-10
    - IO::Socket::SSL doesn't play well with select() [RT#81237] (Jesse Luehrs)

6.05    2012-11-10
    - Convert to Test::More style and disable test on Windows [RT#81090] (Gisle Aas)
    - SSL broken for some servers [RT#81073] (Marinos Yannikos)

6.04    2012-11-08
    - Simpler handling of double chunked [RT#77240] (Gisle Aas)
    - Check for timeouts before reading [RT#72676] (Gisle Aas)
    - Fake can_read (Gisle Aas)
    - Fix chunked decoding on temporary read error [RT#74431] (Dagfinn Ilmari Mannsåker)

META.json  view on Meta::CPAN

            "URI" : "0",
            "base" : "0",
            "perl" : "5.006002",
            "strict" : "0",
            "warnings" : "0"
         },
         "suggests" : {
            "IO::Socket" : "0",
            "IO::Socket::INET6" : "0",
            "IO::Socket::IP" : "0",
            "IO::Socket::SSL" : "2.012",
            "Symbol" : "0"
         }
      },
      "test" : {
         "recommends" : {
            "CPAN::Meta" : "2.120900"
         },
         "requires" : {
            "Data::Dumper" : "0",
            "ExtUtils::MakeMaker" : "0",

META.json  view on Meta::CPAN

         },
         {
            "class" : "Dist::Zilla::Plugin::Prereqs::Soften",
            "config" : {
               "Dist::Zilla::Plugin::Prereqs::Soften" : {
                  "copy_to" : [],
                  "modules" : [
                     "IO::Socket",
                     "IO::Socket::INET6",
                     "IO::Socket::IP",
                     "IO::Socket::SSL",
                     "Symbol"
                  ],
                  "modules_from_features" : null,
                  "to_relationship" : "suggests"
               }
            },
            "name" : "Prereqs::Soften",
            "version" : "0.006003"
         },
         {

META.yml  view on Meta::CPAN

      version: '6.030'
    -
      class: Dist::Zilla::Plugin::Prereqs::Soften
      config:
        Dist::Zilla::Plugin::Prereqs::Soften:
          copy_to: []
          modules:
            - IO::Socket
            - IO::Socket::INET6
            - IO::Socket::IP
            - IO::Socket::SSL
            - Symbol
          modules_from_features: ~
          to_relationship: suggests
      name: Prereqs::Soften
      version: '0.006003'
    -
      class: Dist::Zilla::Plugin::StaticInstall
      config:
        Dist::Zilla::Plugin::StaticInstall:
          dry_run: 0

cpanfile  view on Meta::CPAN

requires "IO::Socket::INET" => "0";
requires "IO::Uncompress::Gunzip" => "0";
requires "URI" => "0";
requires "base" => "0";
requires "perl" => "5.006002";
requires "strict" => "0";
requires "warnings" => "0";
suggests "IO::Socket" => "0";
suggests "IO::Socket::INET6" => "0";
suggests "IO::Socket::IP" => "0";
suggests "IO::Socket::SSL" => "2.012";
suggests "Symbol" => "0";

on 'test' => sub {
  requires "Data::Dumper" => "0";
  requires "ExtUtils::MakeMaker" => "0";
  requires "File::Spec" => "0";
  requires "IO::Select" => "0";
  requires "Socket" => "0";
  requires "Test::More" => "0";
};

dist.ini  view on Meta::CPAN

[Test::Pod::Coverage::Configurable]
trustme = Net::HTTP::Methods => qr/.*/
trustme = Net::HTTP => qr/^(configure|http_connect)$/
trustme = Net::HTTP::NB => qr/^(can_read|sysread)$/
trustme = Net::HTTPS => qr/^(configure|http_connect|http_default_port)$/

[AutoPrereqs]
skip = Net::SSL

[Prereqs / RuntimeSuggests]
IO::Socket::SSL = 2.012

[Prereqs::Soften]
to_relationship = suggests
module          = IO::Socket
module          = IO::Socket::INET6
module          = IO::Socket::IP
module          = IO::Socket::SSL
module          = Symbol

[StaticInstall]
mode = on

lib/Net/HTTP/Methods.pm  view on Meta::CPAN

	my $line = substr($_, 0, $pos+1, "");
	$line =~ s/(\015?\012)\z// || die "Assert";
	return wantarray ? ($line, $1) : $line;
    }
}


sub can_read {
    my $self = shift;
    return 1 unless defined(fileno($self));
    return 1 if $self->isa('IO::Socket::SSL') && $self->pending;
    return 1 if $self->isa('Net::SSL') && $self->can('pending') && $self->pending;

    # With no timeout, wait forever.  An explicit timeout of 0 can be
    # used to just check if the socket is readable without waiting.
    my $timeout = @_ ? shift : (${*$self}{io_socket_timeout} || undef);

    my $fbits = '';
    vec($fbits, fileno($self), 1) = 1;
  SELECT:
    {

lib/Net/HTTPS.pm  view on Meta::CPAN

our $VERSION = '6.23';
use strict;
use warnings;

# Figure out which SSL implementation to use
our $SSL_SOCKET_CLASS;
if ($SSL_SOCKET_CLASS) {
    # somebody already set it
}
elsif ($SSL_SOCKET_CLASS = $ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS}) {
    unless ($SSL_SOCKET_CLASS =~ /^(IO::Socket::SSL|Net::SSL)\z/) {
	die "Bad socket class [$SSL_SOCKET_CLASS]";
    }
    eval "require $SSL_SOCKET_CLASS";
    die $@ if $@;
}
elsif ($IO::Socket::SSL::VERSION) {
    $SSL_SOCKET_CLASS = "IO::Socket::SSL"; # it was already loaded
}
elsif ($Net::SSL::VERSION) {
    $SSL_SOCKET_CLASS = "Net::SSL";
}
else {
    eval { require IO::Socket::SSL; };
    if ($@) {
	my $old_errsv = $@;
	eval {
	    require Net::SSL;  # from Crypt-SSLeay
	};
	if ($@) {
	    $old_errsv =~ s/\s\(\@INC contains:.*\)/)/g;
	    die $old_errsv . $@;
	}
	$SSL_SOCKET_CLASS = "Net::SSL";
    }
    else {
	$SSL_SOCKET_CLASS = "IO::Socket::SSL";
    }
}

require Net::HTTP::Methods;

our @ISA=($SSL_SOCKET_CLASS, 'Net::HTTP::Methods');

sub configure {
    my($self, $cnf) = @_;
    $self->http_configure($cnf);

lib/Net/HTTPS.pm  view on Meta::CPAN

    if ($self->isa("Net::SSL")) {
	if ($cnf->{SSL_verify_mode}) {
	    if (my $f = $cnf->{SSL_ca_file}) {
		$ENV{HTTPS_CA_FILE} = $f;
	    }
	    if (my $f = $cnf->{SSL_ca_path}) {
		$ENV{HTTPS_CA_DIR} = $f;
	    }
	}
	if ($cnf->{SSL_verifycn_scheme}) {
	    $@ = "Net::SSL from Crypt-SSLeay can't verify hostnames; either install IO::Socket::SSL or turn off verification by setting the PERL_LWP_SSL_VERIFY_HOSTNAME environment variable to 0";
	    return undef;
	}
    }
    $self->SUPER::configure($cnf);
}

sub http_default_port {
    443;
}

lib/Net/HTTPS.pm  view on Meta::CPAN

Net::HTTPS - Low-level HTTP over SSL/TLS connection (client)

=head1 VERSION

version 6.23

=head1 DESCRIPTION

The C<Net::HTTPS> is a low-level HTTP over SSL/TLS client.  The interface is the same
as the interface for C<Net::HTTP>, but the constructor takes additional parameters
as accepted by L<IO::Socket::SSL>.  The C<Net::HTTPS> object is an C<IO::Socket::SSL>
too, which makes it inherit additional methods from that base class.

For historical reasons this module also supports using C<Net::SSL> (from the
Crypt-SSLeay distribution) as its SSL driver and base class.  This base is
automatically selected if available and C<IO::Socket::SSL> isn't.  You might
also force which implementation to use by setting $Net::HTTPS::SSL_SOCKET_CLASS
before loading this module.  If not set this variable is initialized from the
C<PERL_NET_HTTPS_SSL_SOCKET_CLASS> environment variable.

=head1 ENVIRONMENT

You might set the C<PERL_NET_HTTPS_SSL_SOCKET_CLASS> environment variable to the name
of the base SSL implementation (and Net::HTTPS base class) to use.  The default
is C<IO::Socket::SSL>.  Currently the only other supported value is C<Net::SSL>.

=head1 SEE ALSO

L<Net::HTTP>, L<IO::Socket::SSL>

=head1 AUTHOR

Gisle Aas <gisle@activestate.com>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2001 by Gisle Aas.

This is free software; you can redistribute it and/or modify it under

t/00-report-prereqs.dd  view on Meta::CPAN

                                      'URI' => '0',
                                      'base' => '0',
                                      'perl' => '5.006002',
                                      'strict' => '0',
                                      'warnings' => '0'
                                    },
                      'suggests' => {
                                      'IO::Socket' => '0',
                                      'IO::Socket::INET6' => '0',
                                      'IO::Socket::IP' => '0',
                                      'IO::Socket::SSL' => '2.012',
                                      'Symbol' => '0'
                                    }
                    },
       'test' => {
                   'recommends' => {
                                     'CPAN::Meta' => '2.120900'
                                   },
                   'requires' => {
                                   'Data::Dumper' => '0',
                                   'ExtUtils::MakeMaker' => '0',

t/live-https.t  view on Meta::CPAN

            Timeout  => 5,
        );
        die "Can't connect: $@" unless $s;
    };
    if ($@) {
        print "1..0 # SKIP Can't connect to www.cpan.org:443\n";
        print $@;
        exit;
    }

    unless ( eval { require IO::Socket::SSL } || eval { require Net::SSL } ) {
        print "1..0 # SKIP IO::Socket::SSL or Net::SSL not available\n";
        print $@;
        exit;
    }
}

use strict;
use warnings;
use Test::More;
plan tests => 6;



( run in 0.471 second using v1.01-cache-2.11-cpan-05444aca049 )