title: Error: 500 Can't connect to example.com:443 (certificate verify failed)
body: <p>I get that error. Here is my code.</p>
  <pre><code>   use LWP::UserAgent;
      use HTTP::Request::Common qw(POST);
      use HTTP::Cookies;
  
  $URL=&quot;https://example.com/my.plicy&quot;;
  $UA = LWP::UserAgent-&gt;new();
  $UA-&gt;ssl_opts( verify_hostnames =&gt; 0 ); 
  #UA-&gt;ssl_opts( SSL_ca_file =&gt; Mozilla::CA::SSL_ca_file() );
  
  $req =HTTP::Request::Common::POST(&quot;$URL&quot;,
     Content_type=&gt;'form-data',
     Content =&gt;[
           'username'=&gt;'111',
           'password'=&gt;'2222',
           'vhost'=&gt;'standard'
     ]
  );
  $req-&gt;header('Cookie' =&gt;q(TIN=287000; LastMRH_Session=439960f5; MRHSession=78c9c47291c1fcedae166121439960f5));
  
  
  $resp=$UA-&gt;request($req);
  
  if( ($resp-&gt;code() &gt;= 200) &amp;&amp; ($resp-&gt;code() &lt;400) ) {
    print $resp-&gt;decoded_content;
  
  }else{
    print &quot;Error: &quot;. $resp-&gt;status_line. &quot;\n&quot;;
  }
     
  </code></pre>
  <p>The problem is that I have no real certificate to provide, because the site is in development stages, and a certificate of the localhost is used... the browsers don't recognize it.</p>
  <p>Is there a way to bypass the verification?? and avoid the error?</p>
  <p><strong>UPDATE:</strong></p>
  <p>I changed my code a bit. Added another library and added this function:</p>
  <pre><code>use CACertOrg::CA;
  
  $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;
  
  $UA-&gt;ssl_opts(
      verify_hostnames =&gt; 0,
      SSL_ca_file      =&gt; CACertOrg::CA::SSL_ca_file()
  );
  </code></pre>
  <p>Now I get this:</p>
  <blockquote>
  <hr />
  </blockquote>
  <p>Using the default of SSL_verify_mode of SSL_VERIFY_NONE for client
  is deprecated! Please set SSL_verify_mode to SSL_VERIFY_PEER
  together with SSL_ca_file|SSL_ca_path for verification.
  If you really don't want to verify the certificate and keep the
  connection open to Man-In-The-Middle attacks please set
  SSL_verify_mode explicitly to SSL_VERIFY_NONE in your application.</p>
  <hr />
  <p>at C:/Perl/lib/LWP/Protocol/http.pm line 31.</p>
  <p>So I changed the options to this:</p>
  <pre><code>    $UA-&gt;ssl_opts(
       SSL_verify_mode   =&gt; 'SSL_VERIFY_NONE',
      verify_hostnames =&gt; 0,
      SSL_ca_file      =&gt; CACertOrg::CA::SSL_ca_file()
  );
  </code></pre>
  <p>I get nothing printed... I don't get an error, though. Is it a good sign?</p>