Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Possible Encrypted response using SSLeay

by dwatson06 (Friar)
on Jun 27, 2002 at 16:07 UTC ( #177746=perlquestion: print w/replies, xml ) Need Help??
dwatson06 has asked for the wisdom of the Perl Monks concerning the following question:

I am using SSLeay to connect to a cgi script on another server. I have connected to the other server gotten their header information, but then I get what appears to be an encrypted error/response message: 005 NN_NGH N S

use LWP::UserAgent; use Crypt::SSLeay; my $ua = new LWP::UserAgent; my $req = HTTP::Request->new('POST', ' +e_user.cgi', HTTP::Headers->new( Content_Type => 'application/x-www-form-urlencoded', Content_Length => 21, Content => '<User>John.Doe</User>', )); my $res = $ua->request($req); print $res->content;
It was suggested that I need to strip the parity bit.(???) How can I make the response readable?
Thank you

2002-06-27 Edit by Corion : Moved to Seekers of Perl Wisdom and added CODE tags

Replies are listed 'Best First'.
Re: Possible Encrypted response using SSLeay
by dws (Chancellor) on Jun 27, 2002 at 17:37 UTC
    The request you're creating isn't actually using url encoding, perhaps because you're working too hard at it by supplying your own headers. To see what I mean, add   print $req->as_string();
    after you've created the request, and note that the form is not correctly encoded. I suspect this is causing problems on the far end. A simpler approach is to do
    use HTTP::Request::Common qw(POST); $req = POST '', [ Content => "<User>John.Doe</User>" ]; print $req->as_string();
    and note the difference. The form is correctly URL encoded, and Content-length has been adjusted accordingly.

    Note that once Crypt::SSLeay is installed, you don't need to use it explicitly. LWP will use it automagically when it sees 'https'. You can even leave :443 out of the URL, since it is implied by 'https'.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://177746]
Approved by davis
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2018-06-17 23:17 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (107 votes). Check out past polls.