What module is needed to allow scripts to post to HTTPS sites?

What module is needed to allow scripts to post to HTTPS sites?

am 02.08.2006 14:06:14 von petesouthwest

Hi

I have been told that in order for my Perl script to be able to post
to an https address, there needs to be an extra library/object
installed on my server, like CURL for php. Can anyone tell me the name
of the library? Is there just one or are there alternatives?

Many thanks

Pete

Re: What module is needed to allow scripts to post to HTTPS sites?

am 02.08.2006 14:54:45 von petesouthwest

petesouthwest@hotmail.com wrote:
> Hi
>
> I have been told that in order for my Perl script to be able to post
> to an https address, there needs to be an extra library/object
> installed on my server, like CURL for php. Can anyone tell me the name
> of the library? Is there just one or are there alternatives?
>
> Many thanks
>
> Pete

I think my host is using CPAN Perl?

Re: What module is needed to allow scripts to post to HTTPS sites?

am 02.08.2006 15:10:00 von Peter Scott

On Wed, 02 Aug 2006 05:06:14 -0700, petesouthwest wrote:
> I have been told that in order for my Perl script to be able to post
> to an https address, there needs to be an extra library/object
> installed on my server, like CURL for php. Can anyone tell me the name
> of the library?

CPAN: Crypt::SSLeay.

> Is there just one or are there alternatives?

Maybe Net::SSLeay would work equally; haven't tried.

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

Re: What module is needed to allow scripts to post to HTTPS sites?

am 02.08.2006 15:14:10 von Sisyphus

wrote in message
news:1154520374.559629.264450@i3g2000cwc.googlegroups.com...
> Hi
>
> I have been told that in order for my Perl script to be able to post
> to an https address, there needs to be an extra library/object
> installed on my server, like CURL for php. Can anyone tell me the name
> of the library? Is there just one or are there alternatives?
>

No expert on this - but I think there are alternatives.

LWP::UserAgent has both a 'get' and 'post' method. Here's a simple script
that does a https 'get':

use warnings;
use strict;
use LWP::UserAgent;

my $url = 'https://www.thawte.com';

my $ua = new LWP::UserAgent;

my $req = new HTTP::Request('GET', $url);

my $res = $ua->request($req);

if ($res->is_success) {print $res->as_string}

else {print "Failed: ", $res->status_line, "\n"}

__END__

On my box that works because I have both IO::Socket::SSL and Net::SSLeay
installed. (The latter is needed by the former.)
If I rename either one of those modules (so that it cannot be found) the
script fails with the message:

Failed: 501 Protocol scheme 'https' is not supported (Crypt::SSLeay not
installed)

From that I deduce that Crypt::SSLeay is an alternative to the
IO::Socket::SSL/Net::SSLeay combination. Crypt::SSLeay has not been updated
in over 4 years ... so I'm a little wary (perhaps without justification) of
it.

There are probably other alternatives to LWP::UserAgent - eg WWW::Mechanize.
I would think that they too utilize IO::Socket::SSL/Net::SSLeay and/or
Crypt::SSLeay ... but I haven't checked.

Cheers,
Rob

Re: What module is needed to allow scripts to post to HTTPS sites?

am 02.08.2006 16:04:03 von rvtol+news

Sisyphus schreef:
> petesouthwest:

>> I have been told that in order for my Perl script to be able to post
>> to an https address, there needs to be an extra library/object
>> installed on my server, like CURL for php. Can anyone tell me the
>> name of the library? Is there just one or are there alternatives?
>
> No expert on this - but I think there are alternatives.
>
> LWP::UserAgent has both a 'get' and 'post' method.
> [....]
> There are probably other alternatives to LWP::UserAgent - eg
> WWW::Mechanize. I would think that they too utilize
> IO::Socket::SSL/Net::SSLeay and/or Crypt::SSLeay ... but I haven't
> checked.

See also IO::All. From the documentation of IO::All::HTTPS
"Note that in most cases it is simpler just to call
io('https://example.com'), which calls the https method automatically.
[...] The same operators from IO::All may be used. < GETs an HTTPS URL;
> PUTs to an HTTPS URL."

--
Affijn, Ruud

"Gewoon is een tijger."

Re: What module is needed to allow scripts to post to HTTPS sites?

am 02.08.2006 17:44:20 von petesouthwest

Peter Scott wrote:
> On Wed, 02 Aug 2006 05:06:14 -0700, petesouthwest wrote:
> > I have been told that in order for my Perl script to be able to post
> > to an https address, there needs to be an extra library/object
> > installed on my server, like CURL for php. Can anyone tell me the name
> > of the library?
>
> CPAN: Crypt::SSLeay.
>
> > Is there just one or are there alternatives?
>
> Maybe Net::SSLeay would work equally; haven't tried.
>
> --
> Peter Scott
> http://www.perlmedic.com/
> http://www.perldebugged.com/


Thats great thank you all. I'm not up on Perl or webservers, so this
helps a lot. My Host has said to offer SSL I would need to upgrade to a
dedicated server :( at over =A3100
a month.

Is installing something like Crypt::SSLeay difficult? Any ideas why I
should need to upgrade to a dedicated server in order to get SSL
support?

Can I just clarify how this relates to having an SSL cert? When i have
asked this question to other poeple they have started talking about
secure sites. but isnt that different from support for the SSL
protocol?

Many thanks
Pete

Re: What module is needed to allow scripts to post to HTTPS sites?

am 03.08.2006 15:27:53 von Peter Scott

On Wed, 02 Aug 2006 08:44:20 -0700, petesouthwest wrote:
> Peter Scott wrote:
>> On Wed, 02 Aug 2006 05:06:14 -0700, petesouthwest wrote:
>> > I have been told that in order for my Perl script to be able to post
>> > to an https address, there needs to be an extra library/object
>> > installed on my server, like CURL for php. Can anyone tell me the name
>> > of the library?
>>
>> CPAN: Crypt::SSLeay.
>
> Thats great thank you all. I'm not up on Perl or webservers, so this
> helps a lot. My Host has said to offer SSL I would need to upgrade to a
> dedicated server :( at over £100
> a month.

That of course is completely unrelated to your original question, which
was about accessing a site, not serving a site.

> Is installing something like Crypt::SSLeay difficult?

Usually not; YMMV.

> Any ideas why I
> should need to upgrade to a dedicated server in order to get SSL
> support?

They're using it as an excuse to make more money? :-)

> Can I just clarify how this relates to having an SSL cert? When i have
> asked this question to other poeple they have started talking about
> secure sites. but isnt that different from support for the SSL protocol?

Your problem appears to be clarifying what it is that you want, because I
cannot tell why you are talking about posting to an https address at the
same time as serving a secure site. Unless what you mean by 'post' is
different from the usual interpretation of an HTTP request. What *do* you
mean by 'post'?

--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/

Re: What module is needed to allow scripts to post to HTTPS sites?

am 04.08.2006 16:54:26 von Stephan Titard

petesouthwest@hotmail.com escribió:
> Hi
>
> I have been told that in order for my Perl script to be able to post
> to an https address, there needs to be an extra library/object
> installed on my server, like CURL for php. Can anyone tell me the name
> of the library? Is there just one or are there alternatives?
>
> Many thanks
>
> Pete
>
Crypt::SSLeay is maintained to enable https requests wia libwww (LWP)
so install that if you use LWP

Net::SSLeay is the way to go for new code.

both depend on openssl. see www.openssl.org to install it.

if you want to use the curl perl modules(like WWW::Curl::Easy), you'll
need libcurl with
openssl support

overall highly OS-dependent as you need to build C libraries
the openssl build process has become worse lately on some platforms
as libopenssl has been split in two (one has become a dependency of the
other and tries to load ./libXXX instead of the full path)
if your platform uses /usr/local or /usr/lib only everything is OK.

hth
--stephan