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

Does anyone have any fuctional example performing a HTTPS POST using the Crypt:SSLeay module without a client side certificate? Thanks in advance.

Replies are listed 'Best First'.
Re: Crypt::SSLeay performing a HTTP POST
by almut (Canon) on Jun 04, 2010 at 16:56 UTC

    I suppose you mean using Crypt:SSLeay via LWP:

    #!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = LWP::UserAgent->new(); my $resp = $ua->post( "https://www.website.ws/members/index.dhtml", [ userid => 'foo', pwd => 'bar', language => 'english', form => 1, page => '', func => '', pagedrop => '', ] ); if ($resp->is_success) { print $resp->decoded_content; } else { print $resp->status_line; }
    $ ./843152.pl | grep login-error <p class="login-error">Too many login attempts.<BR>Please contact Cust +omer Service at (1) 760-602-3000, M-F, 8:00 am - 5:00 pm, PST.</p> $ strace -eopen ./843152.pl 2>&1 | grep Crypt/SSLeay.pm open("/usr/lib/perl5/Crypt/SSLeay.pm", O_RDONLY) = 4

      Thanks. I do not see a use Crypt::SSLeay line. Is there a clear definition of the parameters to be passed in the post. I understand it will be dependent upon the number of fields on the page to complete, but I am confused on what other parameters are required versus optional. For example - language.

        I do not see a use Crypt::SSLeay line.

        That's why I supplied the strace as 'proof' :) — Crypt::SSLeay is loaded automatically for HTTPS requests.

        Is there a clear definition of the parameters to be passed in the post...

        That's entirely site/URI-dependent. I just made a request using Firefox and traced it using the "Live HTTP Headers" addon to see what's being sent.

Re: Crypt::SSLeay performing a HTTP POST
by Anonymous Monk on Jun 04, 2010 at 16:29 UTC
    What do you mean?