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

Hi
I'm trying to get a perl script to do a SSL form submission for me.

Essentially:
use HTTP::Request::Common;
use LWP::UserAgent;

$submitpage = "https://domain/page.cgi";
$ua = LWP::UserAgent->new();

push @namevaluearray, ("fieldname", "fieldvalue");

my $req = POST $submitpage, \@namevaluearray;

$content = $ua->request($req)->as_string;

print $content . "\n";


The headers (of the reply page, which tells me that the form submission has failed, because a field is incorrectly formatted (although its definately correctly formatted)) show this:

Client-SSL-Warning: Peer certificate not verified.

Does this mean that the SSL layer stuff has failed and if so what am I doing wrong ?

Thanks

Specimen

Replies are listed 'Best First'.
RE: posting ssl request.
by bastard (Hermit) on Aug 31, 2000 at 21:14 UTC
      Hi

      Thanks for the link. To quote (for future monk reference):
      Also for those that that have not figured this out already:  All
      response headers prefixed with "Client-" are things that LWP adds by
      itself.  It is not something that the server actually sent as a
      header.
      
      So looks like the 'error' is just a header which LWP tags on to the response (it cant verify that the SSL certificate is genuine, only that there is one (ie for all LWP knows, the certificate proporting to be from Microsoft or whatever may not actually be) - this is my interpretation - it may not be right). Anyway, all this leaves me still scratching my head wondering why the script doesnt work; for testing I pulled all the field entries from the real web page and used those values in the script. Oh well back to the drawing board.

      Thanks

      Specimen
(jeffa) Re: posting ssl request.
by jeffa (Bishop) on Aug 31, 2000 at 21:05 UTC
    Did you install Open SSL on your 'puter?
      # openssl version
      OpenSSL 0.9.5a 1 Apr 2000
      #
      
      Also have Crypt-SSLeay-0.16, IO-Socket-SSL-0.75 and 
      Net_SSLeay.pm-1.05 on my machine. I'm not sure which of all
      those things it is actually using but I installed them at
      some stage while reading what documentation I could find to
      get this 'working'.
      
      Thanks
      
      Specimen