2012-07-18 6 views
17

Ich habe eine Linux-Box in einer Unternehmensumgebung, in der Web-Zugriff über einen Proxy, der Authentifizierung erfordert, gated ist.Verwenden von CPAN mit einem Proxy fehlgeschlagen nach o conf init/proxy/

Während eines ersten Lauf von cpan es automatisch konfiguriert alles, was es normalerweise der Fall ist:

Autoconfigured everything but 'urllist'. Please call 'o conf init urllist' to configure your CPAN server(s) now!

commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'

Zu wissen, dass ich einen Proxy zu navigieren, und die Dokumentation gelesen und mehrere Seiten auf dem Internet über Proxy und cpan I:

cpan[1]> o conf init /proxy/

If you're accessing the net via proxies, you can specify them in the CPAN configuration or via environment variables. The variable in the $CPAN::Config takes precedence.

Your ftp_proxy? []

Your http_proxy? [] 10.12.8.9:3128

Your no_proxy? []

If your proxy is an authenticating proxy, you can store your username permanently. If you do not want that, just press RETURN. You will then be asked for your username in every future session.

Your proxy user id? [] my_net_id

Your password for the authenticating proxy can also be stored permanently on disk. If this violates your security policy, just press RETURN. You will then be asked for the password in every future session.

CPAN: Term::ReadKey loaded ok (v2.30) Your proxy password? Please remember to call 'o conf commit' to make the config permanent!

cpan[2]> o conf commit commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'

Alles sollte jetzt gut sein, oder? So wünsche ich,

cpan[3]> i /Some::Module/ CPAN: Storable loaded ok (v2.18)

I would like to connect to one of the following sites to get 'authors/01mailrc.txt.gz':

http://www.perl.org/CPAN/ ftp://ftp.perl.org/pub/CPAN/

Is it OK to try to connect to the Internet? [yes] LWP not available

Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get http://www.perl.org/CPAN/authors/01mailrc.txt.gz curl: (22) The requested URL returned error: 407

System call "/usr/bin/curl -L -f -s -S --netrc-optional " http://www.perl.org/CPAN/authors/01mailrc.txt.gz " > /root/.cpan/sources/authors/01mailrc.txt.tmp29726" returned status 22 (wstat 5632) Warning: expected file [/root/.cpan/sources/authors/01mailrc.txt.gz.tmp29726] doesn't exist

Trying with "/usr/bin/wget -O /root/.cpan/sources/authors/01mailrc.txt.tmp29726" to get http://www.perl.org/CPAN/authors/01mailrc.txt.gz --2012-07-17 15:57:38-- http://www.perl.org/CPAN/authors/01mailrc.txt.gz Connecting to 10.12.8.9:3128... connected. Proxy request sent, awaiting response... 301 Moved Permanently Location: http://www.cpan.org/authors/01mailrc.txt.gz [following] --2012-07-17 15:57:38-- http://www.cpan.org/authors/01mailrc.txt.gz Connecting to 10.12.8.9:3128... connected. Proxy request sent, awaiting response... 407 Proxy Authentication Required 2012-07-17 15:57:38 ERROR 407: Proxy Authentication Required.

Also das Kennwort fragt, wo ist?

Was fehlt mir bei der Konfiguration von cpan für den Zugriff auf das Internet über den Unternehmens-Proxy mit Authentifizierung?

Antwort

9

Installieren Sie LWP. Das cpan-Dienstprogramm verwendet curl, ich denke, es konnte LWP nicht laden. Es werden keine Proxy-Parameter an curl übergeben, daher müssen Sie den Export http_proxy = http: // host: port/ausführen, bevor Sie den Befehl ausführen.

Oder, wenn Sie LWP mit dem Paketmanager Ihrer Distribution installieren können, sollte es den Proxy-Zugriff korrekt konfigurieren.

+0

Wir haben einen Gewinner. Obwohl es so aussieht, als würde man den Wagen vor das Pferd stellen, ist es möglich, LWP und seine 18 Abhängigkeiten von Hand zu installieren und dann wird cpan durch den Proxy navigieren. @ Luciano hat es. – MichaelRpdx

+0

Als Alternative zur manuellen Installation von 19 Paketen von CPAN versuchen Sie 'o conf', indem Sie alle drei' http_proxy', 'proxy_user' und' proxy_pass' auf die leere Zeichenfolge setzen (oder sie aus '~/.cpan/CPAN entfernen)/MyConfig.pm' mit einem Texteditor). Stellen Sie dann sicher, dass 'HTTP_PROXY',' HTTPS_PROXY' und die Kleinbuchstaben in Ihrer Shell-Umgebung gesetzt und exportiert werden. _Das funktionierte für mich mit einer brandneuen Perl-Installation von der Quelle und einem firmeninternen HTTP-Proxy, der Authentifizierung erfordert. _ – TheDudeAbides

3

können Sie versuchen, diese mit vor cpan Aufruf:

export http_proxy=http://my_net_id:[email protected]:3128/ 

Auf diese Weise vielleicht curl den Proxy verwenden.

+0

Tatsächlich ist die Eingabe '10.12.8.9: 3128' sieht falsch. Es sollte eher "http: //10.12.8.9: 3128" heißen. – daxim

+0

@Paulo Das hatte keine Wirkung – MichaelRpdx

+0

@ daxim Hinweis von den Protokollen, die ich gepostet cpan verbindet sich mit dem Proxy-Server, es ist nur nicht die erforderliche Authentifizierung – MichaelRpdx

22

Sie müssen absolute Proxy-URL-Adresse für die Konfiguration von CPAN-Proxy-Einstellungen angeben. Mach dir keine Sorgen, anstatt einfach IP-Adresse und Port-Nummer anzugeben, bitte wie unten angegeben angeben.

cpan> o conf init /proxy/ 

Your ftp_proxy? [] ftp://10.12.8.9:3128 

Your http_proxy? [] http://10.12.8.9:3128 

Your no_proxy? [] 

und bieten Benutzernamen und Passwort bei Bedarf (Stellen Sie sicher, dass Sie das Herunterladen Berechtigung)

Ich habe auch denselben das Problem, aber das ist jetzt für mich arbeiten. Ich sollte auch für dich arbeiten.

BR Jerry James

+0

Das war die richtige Antwort für mich, den Proxy zu entfernen. Vorhandener Docker Bild/Container hatte ein env von http_proxy und ich wollte es deaktivieren. –

Verwandte Themen