title: SSL certificate problem with cURL - sslcerts
body: <p>I am trying establish communication between my Linux server (Debian GNU/Linux 10 buster) and a microservice located in another server. Telnet is working fine, but when I try to execute a curl, I get this error:</p>
  <pre><code>$ curl &quot;https://url.com.br/path&quot;
  </code></pre>
  <blockquote>
  <p>curl: (60) SSL certificate problem: unable to get local issuer
  certificate More details here: <a href="https://curl.haxx.se/docs/sslcerts.html" rel="nofollow noreferrer">https://curl.haxx.se/docs/sslcerts.html</a></p>
  <p>curl failed to verify the legitimacy of the server and therefore could
  not establish a secure connection to it. To learn more about this
  situation and how to fix it, please visit the web page mentioned
  above.</p>
  </blockquote>
  <p>I also have 2 .cer but I am not sure what I should do</p>
  <p>EDIT:</p>
  <p>Tried to execute with -kv as @kashif suggested and here is the output:</p>
  <pre><code>* Expire in 0 ms for 6 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 1 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  * Expire in 0 ms for 1 (transfer 0x556613046fb0)
  *   Trying IP...
  * TCP_NODELAY set
  * Expire in 200 ms for 4 (transfer 0x556613046fb0)
  * Connected to url.com.br (IP) port 443 (#0)
  * ALPN, offering http/1.1
  * successfully set certificate verify locations:
  *   CAfile: none   CApath: /etc/ssl/certs
  * TLSv1.3 (OUT), TLS handshake, Client hello (1):
  * TLSv1.3 (IN), TLS handshake, Server hello (2):
  * TLSv1.2 (IN), TLS handshake, Certificate (11):
  * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  * TLSv1.2 (IN), TLS handshake, Server finished (14):
  * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
  * TLSv1.2 (OUT), TLS handshake, Finished (20):
  * TLSv1.2 (IN), TLS handshake, Finished (20):
  * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
  * ALPN, server accepted to use http/1.1
  * Server certificate:
  *  subject: C=BR; ST=SP; L=S㯠Paulo; O=EMPRESA; OU=SIT; CN=URL
  *  start date: Jun 22 19:02:03 2021 GMT
  *  expire date: Jun 21 19:02:03 2024 GMT
  *  issuer: DC=br; DC=com; DC=EMPRESA; CN=EMPRESA Subordinate CA - Novo
  *  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
  &gt; GET /PATH HTTP/1.1
  &gt; Host: URL
  &gt; User-Agent: curl/7.64.0
  &gt; Accept: */*
  &gt; 
  * TLSv1.2 (IN), TLS handshake, Hello request (0):
  * TLSv1.2 (OUT), TLS handshake, Client hello (1):
  * TLSv1.2 (IN), TLS handshake, Server hello (2):
  * TLSv1.2 (IN), TLS handshake, Certificate (11):
  * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  * TLSv1.2 (IN), TLS handshake, Request CERT (13):
  * TLSv1.2 (IN), TLS handshake, Server finished (14):
  * TLSv1.2 (OUT), TLS handshake, Certificate (11):
  * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
  * TLSv1.2 (OUT), TLS handshake, Finished (20):
  * TLSv1.2 (IN), TLS handshake, Finished (20):
  * old SSL session ID is stale, removing &lt; HTTP/1.1 404 Not Found &lt; Content-Type: text/html &lt; Server: Microsoft-IIS/10.0 &lt; Date: Fri, 18 Mar 2022 14:01:48 GMT &lt; Content-Length: 1245 &lt;  &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt; &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt; &lt;head&gt; &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;/&gt; &lt;title&gt;404 - File or directory not found.&lt;/title&gt; &lt;style type=&quot;text/css&quot;&gt; &lt;!-- body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;} fieldset{padding:0 15px 10px 15px;}  h1{font-size:2.4em;margin:0;color:#FFF;} h2{font-size:1.7em;margin:0;color:#CC0000;}  h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
  #header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:&quot;trebuchet MS&quot;, Verdana, sans-serif;color:#FFF; background-color:#555555;}
  #content{margin:0 0 0 2%;position:relative;} .content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
  --&gt; &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id=&quot;header&quot;&gt;&lt;h1&gt;Server Error&lt;/h1&gt;&lt;/div&gt; &lt;div id=&quot;content&quot;&gt;  &lt;div class=&quot;content-container&quot;&gt;&lt;fieldset&gt;   &lt;h2&gt;404 - File or directory not found.&lt;/h2&gt;   &lt;h3&gt;The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.&lt;/h3&gt;  &lt;/fieldset&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;
  * Connection #0 to host URL left intact
  </code></pre>