Hi everybody, I'm currently using LWP to try and connect to an XML page via SSL. I do have to go through a proxy for name resolution since I'm connecting from a closed network. I get this response:
HTTP/1.1 500 Server Error Connection: close Date: Wed, 16 May 2007 15:23:37 GMT Server: NetCache appliance (NetApp/5.6.1D25DEBUG3) Content-Length: 284 Content-Type: text/html Client-Date: Wed, 16 May 2007 15:23:38 GMT Client-Peer: 171.182.207.166:8080 Client-Response-Num: 1 Title: 500 Server Error <HTML> <HEAD><TITLE>500 Server Error</TITLE></HEAD> <BODY> <H1>Server Error</H1> <H4> The following error occurred:<P> [code=PARENT_NEEDED] Unable to service this URL without parent cache.C +ontact your system administrator. </H4> <HR> Please contact the administrator. </BODY> </HTML>
Information on how to resolve this, especially regarding Perl, is scarce.

I'm using Perl 5.8.8, on a Solaris 10 system, and as far as I know, all the necessary packages for SSL support (Crypt::SSLeay and OpenSSL) are installed.

The code (cleansed of real world information):

use strict; use LWP; my $ua = LWP::UserAgent->new(); $ua->proxy(['http', 'https'], 'http://proxy:8080'); my $req = HTTP::Request->new(GET => 'http://www.sslsite.com'); my $res = $ua->request($req); my $content = $res->as_string;
I've tested the functionality of the proxy hitting yahoo.com so I know I can reach the web, so I'm guessing there IS an issue with the SSL Setup, i just don't know what to check.

Any help is much appreciated.

UPDATE:
After poking around some in the Crypt::SSLeay docs, I found that the proxy information needs to be provided through environment variables rather than to the UserAgent object as it is in my original code. So:

$ENV{HTTPS_PROXY} = 'http://proxy'; $ENV{HTTPS_PROXY_USERNAME} = 'user'; $ENV{HTTPS_PROXY_PASSWORD} = 'pass';
Took care of everything.


dsb
This @ISA my( $cool ) %SIG

In reply to LWP & HTTPS Problem - PARENT_NEEDED by dsb

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.