Perl LWP agent problems posting to https site

Posted on 2014-07-10
Last Modified: 2014-09-28
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("", content => { request => "$xmlout" });

Depending on the setting for verify_hostname I get two different results.
= 0 Bad hostname
= 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.
Question by:geekdad1
    LVL 4

    Expert Comment

    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.
    LVL 1

    Accepted Solution

    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.
    LVL 1

    Author Closing Comment

    I solved the problem on my own.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now