This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id:
33505
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
karpe [...] bear.com
Cc:
AdminCc:

BugTracker
Severity:
Critical
Broken in:
1.9205
Fixed in:
(no value)



Subject: http_proxy, proxy_user, and proxy_pass is not used with curl
Hi, I'm using version 1.9205 of CPAN.pm. I would like to make a few suggestions to improve the experiences of those living behind HTTP proxies. Firstly, thank you for adding support for curl! Inside CPAN::FTP::hostdlhard(): Change this block: } elsif ($f eq 'curl') { $src_switch = ' -L -f -s -S --netrc-optional'; # BEGIN NEW CODE my $http_proxy = $CPAN::Config->{ 'http_proxy' } ; if ($http_proxy !~ m/^\s*$/) { my($proxy_user, $proxy_pass) = &CPAN::LWP::UserAgent::get_proxy_credentials() ; $src_switch .= " -U \"$proxy_user:$proxy_pass\" -x \"$http_proxy\"" ; } # END NEW CODE } Inside CPAN::LWP::UserAgent::get_proxy_credentials(): sub get_proxy_credentials { my $self = shift; my ($user, $password); # You need to add the length() checks. I have a blank password in my # CPAN config, but it doesn't prompt. That doesn't seem right. if ( defined $CPAN::Config->{proxy_user} && $CPAN::Config->{proxy_user}) !~ m/^\s*$/ && defined $CPAN::Config->{proxy_pass} && $CPAN::Config->{proxy_pass}) !~ m/^\s*$/ { $user = $CPAN::Config->{proxy_user}; $password = $CPAN::Config->{proxy_pass}; return ($user, $password); } The same code also needs to be changed for CPAN::LWP::UserAgent::get_non_proxy_credentials(). Also inside CPAN::LWP::UserAgent::_get_username_and_password_from_user(): You should only prompt for user if it is missing and the same for password. At least show the user as the default when prompting again. Probably this needs some kind of cache, otherwise users are forced to enter their credentials many, many times as files are downloaded. Thanks and keep up the great work! Kevin
Le Ven. Fév. 22 00:13:25 2008, kevinarpe a écrit :
Show quoted text
> Hi, > > I'm using version 1.9205 of CPAN.pm. I would like to make a few > suggestions to improve the experiences of those living behind HTTP
proxies. The general solution to define HTTP proxy settings on Unix or for Unix-style tools (such as curl or wget, even on Win32) is to set the http_proxy/ftp_proxy/no_proxy environment variable. If you set them in the environment in which you launch the CPAN shell they will be given as is to curl/wget/lynx.
I think this issue was resolved by dolmen's answer. Please reopen if there's something left to say. Thanks!


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.