Most esteemed monks,

I have a script pulling back CMDB info from service now using REST API. works a treat on my windows laptop where developed. Move it to Linux and I get a 400 back. I have cut things all the way back and found it is not REST issue, but even a basic LWP get is failing. Here is my test script that work on win, fails on lin.

#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->proxy('https', $ENV{HTTPS_PROXY}); my $response = $ua->get('https://google.com/'); if ($response->is_success) { print $response->decoded_content; # or whatever } else { die $response->status_line; }
Here is the curl test
myaccount@linuxhost:~> curl https://www.google.com <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset +=utf-8"> <TITLE>302 Moved</TITLE></HEAD><BODY> <H1>302 Moved</H1> The document has moved <A HREF="https://www.google.se/?gfe_rd=cr&amp;ei=XwaLWMjfB6Sr8weh06_QD +Q">here</A>. </BODY></HTML>
My HTTPS_PROXY is set, and I can pull back https://google.com with curl. What magic do I miss?

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!

In reply to HTTPS returning 400 from Linux but 200 OK from Windows by Random_Walk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.