title: CURL: have to specify cacert
body: <p>I've got problem with curl and https. I have to specify <code>cacert</code> at every request, can somebody tell me what to do? I use debian jessie.</p>
  
  <pre><code>$ curl -XGET --cacert /etc/ssl/certs/ca-certificates.crt 'https://www.google.com'
  &lt;HTML&gt;&lt;HEAD&gt;&lt;meta http-equiv="content-type" content="text/html;charset=utf-8"&gt;
  &lt;TITLE&gt;302 Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;
  &lt;H1&gt;302 Moved&lt;/H1&gt;
  The document has moved
  &lt;A HREF="https://www.google.fr/?gfe_rd=cr&amp;amp;ei=M69TWfebI4P_8AeJ1KPACA"&gt;here&lt;/A&gt;.
  &lt;/BODY&gt;&lt;/HTML&gt;
  </code></pre>
  
  <p>when I don't specify the <code>cacert</code>:</p>
  
  <pre><code>$ curl -XGET 'https://www.google.com' -v
  * Rebuilt URL to: https://www.google.com/
  * Hostname was NOT found in DNS cache
  *   Trying 216.58.204.132...
  * Connected to www.google.com (216.58.204.132) port 443 (#0)
  * successfully set certificate verify locations:
  *   CAfile: none
    CApath: /etc/ssl/certs
  * SSLv3, TLS Unknown, Unknown (22):
  * SSLv3, TLS handshake, Client hello (1):
  * SSLv2, Unknown (22):
  * SSLv3, TLS handshake, Server hello (2):
  * SSLv2, Unknown (22):
  * SSLv3, TLS handshake, CERT (11):
  * SSLv2, Unknown (21):
  * SSLv3, TLS alert, Server hello (2):
  * SSL certificate problem: unable to get local issuer certificate
  * Closing connection 0
  * SSLv2, Unknown (21):
  * SSLv3, TLS alert, Client hello (1):
  curl: (60) SSL certificate problem: unable to get local issuer certificate
  More details here: http://curl.haxx.se/docs/sslcerts.html
  
  curl performs SSL certificate verification by default, using a "bundle"
   of Certificate Authority (CA) public keys (CA certs). If the default
   bundle file isn't adequate, you can specify an alternate file
   using the --cacert option.
  If this HTTPS server uses a certificate signed by a CA represented in
   the bundle, the certificate verification probably failed due to a
   problem with the certificate (it might be expired, or the name might
   not match the domain name in the URL).
  If you'd like to turn off curl's verification of the certificate, use
   the -k (or --insecure) option.
  </code></pre>
  
  <p>Of course I don't want to ignore certification, I'd like to solve the issue.</p>
  
  <p>My curl version:</p>
  
  <pre><code>$ curl --version
  curl 7.38.0 (x86_64-pc-linux-gnu) libcurl/7.38.0 OpenSSL/1.0.2k zlib/1.2.8 libidn/1.29 libssh2/1.4.3 librtmp/2.3
  Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smtp smtps telnet tftp 
  Features: AsynchDNS IDN IPv6 Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP
  </code></pre>