packetstormer has asked for the wisdom of the Perl Monks concerning the following question:
Howd'y Monks
I have a wierd problem where if I telnet to an https host on the port (443 or 8443) and/or use curl to post to the same url all works OK. However, if I use LWP::UserAgent I get an error 500 - cannot connect to $site.
I am using some very simple code:
#!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; use Data::Dumper; my $host = 'localhost'; my $port = '8443'; my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0}); $ua->agent("Mozilla/29.0"); my $req = HTTP::Request->new( GET => "https://$host:$port" ); $req->header( 'Accept' => 'text/html' ); my $res = $ua->request($req); print Dumper $res;
This code returns an error 500
However, curl or a simple telnet to the same host:port gets a connection (although obviously encrytped in the telnet connection)
Would anyone have any ideas!?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: LWP SSL Question
by zentara (Cardinal) on Jun 06, 2014 at 18:22 UTC | |
Re: LWP SSL Question
by hippo (Archbishop) on Jun 06, 2014 at 16:36 UTC | |
Re: LWP SSL Question
by MidLifeXis (Monsignor) on Jun 06, 2014 at 17:20 UTC | |
by packetstormer (Monk) on Jun 06, 2014 at 17:42 UTC | |
by MidLifeXis (Monsignor) on Jun 06, 2014 at 17:43 UTC | |
by jellisii2 (Hermit) on Jun 06, 2014 at 17:50 UTC | |
Re: LWP SSL Question
by noxxi (Pilgrim) on Jun 07, 2014 at 11:29 UTC | |
by packetstormer (Monk) on Jun 07, 2014 at 18:10 UTC | |
by noxxi (Pilgrim) on Jun 07, 2014 at 19:30 UTC | |
by packetstormer (Monk) on Jun 08, 2014 at 09:56 UTC | |
Re: LWP SSL Question
by taint (Chaplain) on Jun 06, 2014 at 16:18 UTC |