title: wget rejects the site's SSL certificate
body: <p>So I accidentally stumbled upon this error on my server while debugging.</p>
  
  <p>When I request an API url via wget with <code>wget https://example.com/</code>, I get the
  <code>The certificate of «example.com» is not trusted.</code> (The URL is, of course, different)</p>
  
  <p>I did a quick search for a solution and found <a href="https://stackoverflow.com/questions/9224298/how-do-i-fix-certificate-errors-when-running-wget-on-an-https-url-in-cygwin">this question on SO</a>.</p>
  
  <p>The <code>ca-certificates</code> package was already installed. I've ran <code>update-ca-certificates</code> and got the following:</p>
  
  <pre><code>Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done.
  Running hooks in /etc/ca-certificates/update.d....done.
  </code></pre>
  
  <p>I also ran <code>c_rehash</code>, which did add several missing links, but didn't change the outcome.</p>
  
  <p>I checked the server's certificate via <a href="https://www.ssllabs.com/ssltest/" rel="nofollow noreferrer">https://www.ssllabs.com/ssltest/</a> and it passes with flying colors (gives an A+ grade, the certificate issuer is listed as COMODO RSA Domain Validation Secure Server CA). Also, requesting the same document via PHP on the same server works fine.</p>
  
  <p>I also tried explicitly setting <code>--ca-directory=/etc/ssl/certs</code> parameter for wget, but the result is the same.</p>
  
  <p>I have no idea how to troubleshoot this issue further and I'm afraid it might cause issues in the future.</p>
  
  <p>I'm running Debian 7.9 with OpenSSL 1.0.1e 11 Feb 2013.</p>