Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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', 'https://asite.com:443/adir/creat +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

Comment on Possible Encrypted response using SSLeay
Download Code
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 'https://asite.com:443/adir/create_user.cgi', [ 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2014-12-19 15:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (85 votes), past polls