CPAN

 view release on metacpan or  search on metacpan

lib/CPAN.pm  view on Meta::CPAN

                                    # rt #110833
                                    for ("Net::FTP cannot handle http proxy") {
                                        $CPAN::Frontend->mywarn($_);
                                        die $_;
                                    }
                                }
                            },
                            sub {require Net::FTP},
                            sub {require Net::Config},
                           ],
               'IO::Socket::SSL' => [
                                 sub {
                                     require IO::Socket::SSL;
                                     unless (CPAN::Version->vge(IO::Socket::SSL::->VERSION,1.56)) {
                                         for ("Will not use IO::Socket::SSL, need 1.56\n") {
                                             $CPAN::Frontend->mywarn($_);
                                             die $_;
                                         }
                                     }
                                 }
                                ],
               'Net::SSLeay' => [
                                 sub {
                                     require Net::SSLeay;
                                     unless (CPAN::Version->vge(Net::SSLeay::->VERSION,1.49)) {

lib/CPAN/FTP.pm  view on Meta::CPAN

    my($self,$file,$aslocal,$force,$with_defaults) = @_;
    return $aslocal if $self->have_promising_aslocal($aslocal, $force);
    my($aslocal_dir) = dirname($aslocal);
    my $ret;
    $self->mymkpath($aslocal_dir);
    my $aslocal_tempfile = $aslocal . ".tmp" . $$;
    my $base;
    if (
           ($CPAN::META->has_usable('HTTP::Tiny')
            && $CPAN::META->has_usable('Net::SSLeay')
            && $CPAN::META->has_usable('IO::Socket::SSL')
           )
        || $CPAN::Config->{curl}
        || $CPAN::Config->{wget}
       ) {
        for my $prx (qw(https_proxy no_proxy)) {
            $ENV{$prx} = $CPAN::Config->{$prx} if $CPAN::Config->{$prx};
        }
        $base = "https://cpan.org/";
    } else {
        my @missing_modules = grep { ! $CPAN::META->has_usable($_) } qw(HTTP::Tiny Net::SSLeay IO::Socket::SSL);
        my $miss = join ", ", map { "'$_'" } @missing_modules;
        my $modules = @missing_modules == 1 ? "module" : "modules";
        $CPAN::Frontend->mywarn("Missing or unusable $modules $miss, and found neither curl nor wget installed.\n");
        if ($CPAN::META->has_usable('HTTP::Tiny')) {
            $CPAN::Frontend->mywarn("Need to fall back to http.\n")
        }
        for my $prx (qw(http_proxy no_proxy)) {
            $ENV{$prx} = $CPAN::Config->{$prx} if $CPAN::Config->{$prx};
        }
        $base = "http://www.cpan.org/";

lib/CPAN/FTP.pm  view on Meta::CPAN

    my($proto) = $base =~ /^(https?)/;
    my $url = "$base$file";
    # hostdl_2021 may be called with either http or https urls
    if (
        $CPAN::META->has_usable('HTTP::Tiny')
        &&
        (
         $proto eq "http"
         ||
         (    $CPAN::META->has_usable('Net::SSLeay')
              && $CPAN::META->has_usable('IO::Socket::SSL')   )
        )
       ){
        # mostly c&p from below
        require CPAN::HTTP::Client;
        my $chc = CPAN::HTTP::Client->new(
            proxy => $CPAN::Config->{http_proxy} || $ENV{http_proxy},
            no_proxy => $CPAN::Config->{no_proxy} || $ENV{no_proxy},
        );
        for my $try ( $url, ( $url !~ /\.gz(?!\n)\Z/ ? "$url.gz" : () ) ) {
            $CPAN::Frontend->myprint("Fetching with HTTP::Tiny:\n$try\n");

t/32pushyhttps.t  view on Meta::CPAN


unshift @INC, './lib', './t';
require local_utils;
local_utils::cleanup_dot_cpan();
local_utils::prepare_dot_cpan();
local_utils::read_myconfig();
require CPAN::MyConfig;
require CPAN;
CPAN::HandleConfig->load;

for (qw(HTTP::Tiny Net::SSLeay IO::Socket::SSL)) {
    my $has_it = eval "require $_; 1";
    ok $has_it, "found $_" or plan( skip_all => "$_ not available" );
}

{
    package CPAN::Shell::tacet;
    my $output;
    sub init {
        $output = "";
    }

t/32pushyhttps.t  view on Meta::CPAN

        like $o, qr(Please use), "'Please use' on $_" or diag ">>>>$o<<<<";
        $HAVE{$_} = $which;
    } else {
        plan( skip_all => "$_ not found" );
    }
}

like collect_output ( o => conf => pushy_https => 1 ), qr(Please use), "'Please use' on pushy_https";
like collect_output ( o => conf => tar_verbosity => "none" ), qr(Please use), "'Please use' on tar_verbosity";

# | HTTP::Tiny | Net::SSLeay+IO::Socket::SSL | curl | wget | proto |
# |------------+-----------------------------+------+------+-------|
# |          1 |                           1 |    1 |    1 | https | (1)
# |          1 |                           1 |    0 |    0 | https | (2)
# |          1 |                           0 |    0 |    0 | http  | (3)
# |          0 |                           0 |    0 |    0 | -     | (4)
# |          0 |                           0 |    1 |    0 | https | (5)
# |          0 |                           0 |    0 |    1 | https | (6)

my $getmodule = "CPAN::Test::Dummy::Perl5::Make";
my $getdistro_qr = qr(CPAN-Test-Dummy-Perl5-Make);



( run in 0.333 second using v1.01-cache-2.11-cpan-4d50c553e7e )