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

I have a short script that I use to pick up messages via HTTP using a certificate. It works great from my machine, but I can't seem to get it to run anywhere else. The certificates are installed, and I'm not getting any messages that I'm missing modules. Any ideas?

#!/usr/bin/env perl use strict; use WWW::Mechanize; # use LWP::Debug qw(+); $|++; my $username = 'USERNAMEHERE'; my $password = 'PASSWORDHERE'; $ENV{HTTPS_PKCS12_FILE} = 'FILE.pfx'; $ENV{HTTPS_PKCS12_PASSWORD} = 'CERTPASSWORD'; my $mech = WWW::Mechanize->new(); $mech->agent_alias('Windows IE 6'); # Authenticate $mech->get("https://www.example.org/xyz/,DanaInfo=999.33.1.10+"); $mech->get("https://www.example.org/xyz/isapi_pathnet.dll?Page=Login&M +ode=Silent&UserID=" . $username . "&Password=" . $password . ",DanaIn +fo=999.33.1.10"); # Fetch results $mech->get("https://www.example.org/xyz/isapi_pathnet.dll?Page=HL7&Que +ry=NewRequests,DanaInfo=999.33.1.10"); #Print results print $mech->content(); # Acknowledge results $mech->get("https://www.example.org/xyz/isapi_pathnet.dll?Page=HL7&ACK +=Positive,DanaInfo=999.33.1.10"); # Log out $mech->get("https://www.example.org/xyz/isapi_pathnet.dll?Logout=Yes,D +anaInfo=999.33.1.10");

Replies are listed 'Best First'.
Re: Problem with WWW::Mechanize and PFX certificate
by Anonymous Monk on Feb 23, 2010 at 06:33 UTC
    Add
    my $mech = WWW::Mechanize->new( autocheck => 1 ); $mech->add_handler("request_send", sub { shift->dump; return }); $mech->add_handler("response_done", sub { shift->dump; return });
    Then you can investigate