• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

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.
  • 2
1 Solution
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.
geekdad1Author Commented:
The problem turned out to be Comodo firewall.  Turning it off doesn't always seem to help.  And it disables the installer, so trying a re-install was problematic.  I usually check the firewall but Comodo's not a program I've had experience with.
geekdad1Author Commented:
I solved the problem on my own.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now