title: Perl: Cannot Access Web Service with SSL
body: <p>This is my first Perl script. I have installed SOAP::Lite using CPAN and it seems to have gone okay.</p>
  
  <p>I'm trying to access a simple HelloWorld .NET web service. I'm getting an error that seems to be related to Perl or SOAP::Lite not being able to verify the SSL certificate.</p>
  
  <p>Although it looks like it's returning a code of 500, I created a Java client that was able to call the web method just fine, so I don't think the problem is on the web service end.</p>
  
  <p><em>Can anyone point me in the right direction as to how I might get this working?</em></p>
  
  <h2>Script:</h2>
  
  <pre><code>#!/usr/bin/perl
  
  use SOAP::Lite 'trace', 'debug';
  
  $api_ns = "https://www.mydomain.com/edgedev/";
  $api_url = "https://www.mydomain.com/edgedev/ws.asmx";
  $action = "HelloWorld";
  
  my $soap = SOAP::Lite
                  -&gt; readable(1)
                  -&gt; ns($api_ns, 'tns')
                  -&gt; proxy($api_url)
                  -&gt; on_action(sub { return "\"$action\""});
  
  print $soap-&gt;HelloWorld()-&gt;result;
  </code></pre>
  
  <h2>Result</h2>
  
  <pre><code>&lt;soap:Envelope 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:tns="https://www.mydomain.com/edgedev/" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;tns:HelloWorld xsi:nil="true" /&gt;
        &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  SOAP::Transport::HTTP::Client::send_receive: 500 Can't connect to www.mydomain.com:443 (certificate verify failed)
  Content-Type: text/plain
  Client-Date: Tue, 12 Feb 2013 16:40:28 GMT
  Client-Warning: Internal response
  
  Can't connect to www.mydomain.com:443 (certificate verify failed)
  
  You can disable hostname check by setting environment variable PERL_LWP_SSL_VERIFY_HOSTNAME=0
  
  LWP::Protocol::https::Socket: SSL connect attempt failed with unknown errorerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at /usr/lib/perl5/vendor_perl/5.10.0/LWP/Protocol/http.pm line 57.
  500 Can't connect to www.mydomain.com:443 (certificate verify failed) at ./soaptest.pl line 15
  </code></pre>