Link to home
Start Free TrialLog in
Avatar of Doug Poulin
Doug PoulinFlag for Canada

asked on

Perl LWP agent problems posting to https site

I have the following code snippet that runs fine on two machines, but not on the one I need it to run on.

use LWP::UserAgent;

$ua = LWP::UserAgent->new(ssl_opts => {verify_hostname => 1 });
$res = $ua->post("https://tradehouse.net/send/interchange", content => { request => "$xmlout" });

Depending on the setting for verify_hostname I get two different results.
= 0 Bad hostname tradehouse.net:443
= 1 Certificate verification failed

I'm running it successfully on win XP and Win 7.  The problem machine is running Windows 7 and it's a new PC with very little else on it.  Other than being on different networks, and running different firewalls (Comodo is on the machine that fails) Norton is on the machines that work, I don't see a lot of difference between the two installations.

I'm using activestate perl.  I've tried adding Mozilla::CA but that didn't make any difference.  I've run out of ideas to try.
Avatar of kyanwan
kyanwan
Flag of United States of America image

Have you verified that you've Installed the root CA Chain (Certificate/Authority trust chain) for the CA that the site is using?

Because you're listing the system as a "new machine", I'm leaning towards the CA chain may be the issue.
ASKER CERTIFIED SOLUTION
Avatar of Doug Poulin
Doug Poulin
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Doug Poulin

ASKER

I solved the problem on my own.