Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: HTTPS returning 400 from Linux but 200 OK from Windows

by shadowsong (Monk)
on Jan 27, 2017 at 15:09 UTC ( #1180479=note: print w/replies, xml ) Need Help??


in reply to HTTPS returning 400 from Linux but 200 OK from Windows

Hi R

As Anonymous said above… what do you get when you try: lwp-request -m get -USsed  http://ppm.activestate.com/CPAN/authors  http://cpan.perl.org/authors?

When I do it - I get:

C:\Users\shadowsong>lwp-request -m get -USsed http://ppm.activestate. +com/CPAN/authors http://cpan.perl.org/authors GET http://ppm.activestate.com/CPAN/authors User-Agent: lwp-request/6.15 libwww-perl/6.15 407 authenticationrequired Cache-Control: no-cache Date: Fri, 27 Jan 2017 15:05:31 GMT Via: 1.1 10.156.69.200 (McAfee Web Gateway 7.6.2.21509) Proxy-Authenticate: NTLM Content-Length: 3895 Content-Type: text/html Client-Date: Fri, 27 Jan 2017 15:05:31 GMT Client-Peer: 10.156.69.200:3128 Client-Response-Num: 1 Client-Warning: Unsupported authentication scheme 'ntlm' Link: </mwg-internal/de5fs23hu73ds/files/default/stylesheet.css>; rel= +"stylesheet" Proxy-Connection: Keep-Alive Title: McAfee Web Gateway - Notification X-UA-Compatible: IE=7 GET http://cpan.perl.org/authors User-Agent: lwp-request/6.15 libwww-perl/6.15 407 authenticationrequired Cache-Control: no-cache Date: Fri, 27 Jan 2017 15:05:31 GMT Via: 1.1 10.156.69.200 (McAfee Web Gateway 7.6.2.21509) Proxy-Authenticate: NTLM Content-Length: 3873 Content-Type: text/html Client-Date: Fri, 27 Jan 2017 15:05:31 GMT Client-Peer: 10.156.69.200:3128 Client-Response-Num: 1 Client-Warning: Unsupported authentication scheme 'ntlm' Link: </mwg-internal/de5fs23hu73ds/files/default/stylesheet.css>; rel= +"stylesheet" Proxy-Connection: Keep-Alive Title: McAfee Web Gateway - Notification X-UA-Compatible: IE=7

Shadowsong

Replies are listed 'Best First'.
Re^2: HTTPS returning 400 from Linux but 200 OK from Windows
by Random_Walk (Prior) on Jan 27, 2017 at 16:18 UTC

    I get those CPAN urls OK. It looks like the issue is only with HTTPS sites. I have HTTP_PROXY and HTTPS_PROXY set including user/pass details in the form HTTP_PROXY='http://user:pass@proxy.my.net:8080'

    me@linuxbox:~> lwp-request -m get -USsed http://ppm.activestate.com/C +PAN/authors http://cpan.perl.org/authors? GET http://ppm.activestate.com/CPAN/authors/ User-Agent: lwp-request/5.810 GET http://ppm.activestate.com/CPAN/authors --> 301 Moved Permanently GET http://ppm.activestate.com/CPAN/authors/ --> 200 OK Cache-Control: proxy-revalidate Connection: close Date: Fri, 27 Jan 2017 16:11:05 GMT Age: 0 Server: Apache Content-Length: 4728 Content-Type: text/html;charset=UTF-8 Client-Date: Fri, 27 Jan 2017 16:11:53 GMT Client-Peer: 10.244.0.50:83 Client-Response-Num: 1 Title: Index of /CPAN/authors GET http://www.cpan.org/authors/? User-Agent: lwp-request/5.810 GET http://cpan.perl.org/authors? --> 301 Moved Permanently GET http://www.cpan.org/authors? --> 301 Moved Permanently GET http://www.cpan.org/authors/? --> 200 OK Cache-Control: proxy-revalidate Connection: close Date: Fri, 27 Jan 2017 16:11:54 GMT Via: 1.1 varnish-v4 Via: 1.1 varnish Via: 1.1 varnish Accept-Ranges: bytes Age: 0 Server: Apache/2.2.15 (CentOS) Vary: Accept-Encoding Content-Length: 4722 Content-Type: text/html;charset=UTF-8 Client-Date: Fri, 27 Jan 2017 16:11:54 GMT Client-Peer: 10.244.0.50:83 Client-Response-Num: 1 Fastly-Debug-Digest: 492dd663e1697be6e60aeecd19b5bf028765c1b3d66167d36 +df53fb8eefe26c0 Title: Index of /authors X-Cache: MISS, MISS X-Cache-Hits: 0, 0 X-Served-By: cache-lax8636-LAX, cache-bma7023-BMA X-Timer: S1485533514.441262,VS0,VE504
    Now if I go for https://google.com
    me@linuxbox:~> lwp-request -m get -USsed https://google.com GET https://google.com User-Agent: lwp-request/5.810 GET https://google.com --> 400 Bad Request Cache-Control: no-cache Connection: close Pragma: no-cache Content-Length: 677 Content-Type: text/html; charset=utf-8 Client-Date: Fri, 27 Jan 2017 16:16:23 GMT Client-Peer: 10.244.0.50:83 Client-Response-Num: 1 Proxy-Connection: close Title: Request Error
    At this site I have the same proxt settings for http and https, which strikes me as odd, but works fine on my windows lappy.

    Cheers,
    R.

    Pereant, qui ante nos nostra dixerunt!

      Hi R

      Hmmm, try setting the following environment variables:

      HTTP_PROXY_USER=your_proxy_username HTTP_PROXY_PASS=your_proxy_password

      And update HTTP_PROXY to:

      HTTP_PROXY=http://proxy.my.net:8080

      Best of luck!
      Shadowsong

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1180479]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2019-06-20 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (91 votes). Check out past polls.

    Notices?