I am new to perl, below is the code that I have compiled and run to connect using a proxy to get response from the server which requires a client certificate. I am trying to figure out if issue is with my script or on the other end at the host site. Can someone please look at it and give me some directions how i can debug and see the problem. I get error 500 connection timeout when I run this script. Thanks

500 Connect failed: connect: Connection timed out; Connection timed ou +t header ----Content-Type: text/plain Client-Date: Client-Warning: Internal response response --- Connect failed: connect: Connection timed out; Connection timed out at + /usr/lib/perl5/site_perl/5.8.8/LWP/Protocol/http.pm line 31 $
#!/usr/bin/perl use LWP::UserAgent; use LWP::Simple; use HTTP::Request; use HTTP::Response; use strict; $ENV{PERL_NET_HTTPS_SSL_SOCKET_CLASS}="Net::SSL"; $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0; my $ua = new LWP::UserAgent; $ua->timeout(30); $ua->agent(""); $ua->proxy('http', 'http://someproxy.com:80/'); my $h = HTTP::Headers->new(); $h->proxy_authorization_basic('userid','passwordforproxyserver'); #actual server trying to connect to #passing a certificate $ua->ssl_opts( # SSL_ca_file => 'caCertificate.pem', verfiy_hostname => 1, SSL_cert_file => '/home/cert/client_cert.crt', ); # make a https request my $req = HTTP::Request->new('GET', 'https://server.com:443', $h); my $res = $ua->request($req); if ($res->is_success){ print " testing \n " . $res->content; } print "header ----" . $res->headers_as_string; print "response ---" . $res->as_string;

In reply to Using LWP Proxy and Client Certificate Connection timeout by kabachaa

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.