Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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
[Corion]: Yay. Traditional finance situation averted. Bonds can be quoted in amounts (1_000_000 EUR) or per unit (1 unit). And a traditional error is to trade 2_000_000 piece when you meant to trade 2_000_000 EUR.
[Corion]: (one of my scripts simply catches high amounts and I phone people making that trade, ideally before the payment is due)
[Corion]: The sad thing is that my script sits at the end of the pipeline and can only look at the payments due today or tomorrow basically, while there are many more systems further up in the pipeline
[GotToBTru]: better late than never, I guess
[Corion]: GotToBTru: Sure - there is a long and sad story of many frantic cleanups that led us to implement this notification ;)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2017-03-29 11:32 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (347 votes). Check out past polls.