Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

LWP::UserAgent HTTPS problem

by Emanuel (Pilgrim)
on Aug 15, 2001 at 08:11 UTC ( [id://104946]=perlquestion: print w/replies, xml ) Need Help??

Emanuel has asked for the wisdom of the Perl Monks concerning the following question:

Hello.. I'm nearly giving up on this.
Here's what I'm trying to do. I want to POST something to a HTTPS file, that shouldn't be a big deal, should it?

I get everything to work fine on the same URL, not through HTTPS, but with HTTPS i always get errorcode 400 - Bad Request. I checked the logfiles of the remote apache and didn't find anything that helped me on. The Script that gets called doesn't do anything but respond with the data that has been posted (for testing purposes at the moment).

here's my code:

use LWP::UserAgent; use LWP::Protocol::https; use Crypt::SSLeay; my $ua = new LWP::UserAgent; $ua->agent("Avto-Phone.SMS-Router/0.1 ", $ua->agent); my $req = new HTTP::Request POST => 'https://213.253.66.196/router/tes +t.php'; $req->content_type('text/xml'); $req->content("C'mon, display this finally"); my $res = $ua->request($req); if ($res->is_success) { print $res->content; } else { print "FAILED: ", $res->status_line, "\n"; }

anyone has a clue on how to get it working? I'd be glad for any and every advice on this subject!
Thanks in Advance

Emanuel
Emanuel@xconnect.ch

Replies are listed 'Best First'.
Re: LWP::UserAgent HTTPS problem
by Emanuel (Pilgrim) on Aug 15, 2001 at 08:56 UTC
    Follow up to my own post
    the problem seems to be, that the data get's sent as normal HTTP Post, and NOT as https... found this out when running in debug mode and then dumped out the variable content...

    now.. how can I make sure that what I want to be send gets sent encrypted?

    TIA

    Emanuel
    Emanuel@xconnect.ch
      okay... i was able to get things working.. had to reinstall perl and all modules i was using, et voilą, it worked.... wonder what was wrong with my previous installation of perl though....

      cheers!

      emanuel
      emanuel@xconnect.ch
Re: LWP::UserAgent HTTPS problem
by synapse0 (Pilgrim) on Aug 15, 2001 at 10:42 UTC
    Well, I couldn't have guessed what was wrong, but thanks for sharing your debug process and what you found out from it. It's always nice to hear how folks break down their problems and fix em.
    -Syn0

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-24 06:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found