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

I'm having difficulting with the following task, and I hope someone out there can shed some light in the right direction. Here is the problem!

I want to write a perl program to POST data to an SSL website and determine if it was successful, most likely based on the text returned by the website? The data to be posted is a registration number (8 digits).

I'm using Windows NT perl (not unix), and I've downloaded the LWP module, but It keeps reporting the following error code: Failed: 501 Protocol scheme 'https' is not supported.

Here is the sample program: (actual website addr changed to protect the innocent)

#!/usr/local/bin/perl use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(GET => https://webbroker.tdwaterhouse.c +a/'); my $res = $ua->request($req); if ($res->is_success) { print $res->as_string; } else { print "Failed: ", $res->status_line, "\n"; }
the rest of the code would consist of POSTing the actual data value, then GETting the response to see if it was successful.

Well, first off, I can't even access the SSL page. Does anyone know how to get this done using perl with module support for a Microsoft platform?

janitored by ybiC: <code> tags around example code, <tt> tags around error message

Replies are listed 'Best First'.
Re: Post to SSL Site
by theorbtwo (Prior) on Sep 11, 2003 at 19:53 UTC

    A simple hit of search.cpan.org for https lwp would have show you Crypt::SSLeay, with the description "OpenSSL glue that provides LWP https support". As to windows, the docs note that ActiveState has a PPM build available. (ppm from the commandline, install Crypt::SSLeay from the ppm commandline, should do it.) For that matter, LWP comes with a file named README.SSL that contains much the same information (and also points out IO::Socket::SSL, which I did not know about).


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      (ppm from the commandline, install Crypt::SSLeay from the ppm commandline, should do it.)

      Unfortunately, ActiveState hasn't had a PPM for Crypt::SSLeay available for several months. I have no idea why not. Neither do they have IO::Socket::SSL, unless it's hidden in a bundle somewhere.

      If there's a solution for the problem for ActiveState that doesn't involve building from source using tools that I don't have, I'd love to hear about it.

        There are Crypt::SSLeay and IO::Socket::SSL ActivePerl packages in third-party repositories. Both http://thoeryx5.uwinnipeg.ca/ppmpackages/ and http://crazyinsomniac.perlmonk.org/perl/ppm/ have them for 5.6.