title: PERL Get_Server_Certificate certificate verify failed error
body: <p>I'm receiving a certificate error when trying to send a POST message to a website. </p>
  
  <p>The error I'm receiving:</p>
  
  <p><code>LWP::Protocol::https::Socket: SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at /usr/lib/perl5/site_perl/5.8.8/LWP/Protocol/http.pm line 49</code></p>
  
  <p>The code that I'm using is:</p>
  
  <pre><code>my $webpage = "";
  
  my $ua = LWP::UserAgent-&gt;new( );
  $ua-&gt;agent('Mozilla');
  
  $webpage = "https://mysite:444/myapp/app.aspx";
  
  
  my $msg = 'An XML Message';
  
  my $req = POST $webpage, 
                   Content_Type =&gt; 'text/xml',
                   Content =&gt; $msg;
  </code></pre>
  
  <p>So far I've tried a few "fixes" that I've found online:</p>
  
  <p>Tried disabling verify hostname through environment variable:
  <code>$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;</code></p>
  
  <p>Tried disabling verify hostname through ssl_opts:</p>
  
  <pre><code>my $ua = LWP::UserAgent-&gt;new( ssl_opts =&gt; { verify_hostname =&gt; 0 }, );
  </code></pre>
  
  <p>Tried using the Mozilla CA and setting HTTPS_CA_FILE to <code>/usr/lib/perl5/site_perl/5.8.8/Mozilla/CA/cacert.pem</code>?</p>
  
  <p>At this point I'm out of options to try so I'm hoping someone has run into this problem before and can provide assistance.</p>