curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Does cURL accept a CA that is not self signed?

From: Jeffrey Walton via curl-library <>
Date: Thu, 28 Nov 2019 21:02:49 -0500

On Thu, Nov 28, 2019 at 4:58 PM Daniel Stenberg <> wrote:
> On Thu, 28 Nov 2019, Jeffrey Walton via curl-library wrote:
> > I'm having trouble connecting to a server that uses Let's Encrypt.
> With a huuuge portion of the web now using Let's Encrypt certs, I would've
> expected more people to report problems if that would be the case.

Are folks using the Let's Encrypt X3 ca certificate, or the CA Zoo
with 137 ca's?

If it is the CA Zoo, then folks have exponentially increased their
attack surface. I still remember Diginotar [0,1], and more recently
companies like Symantec issuing certificates for domains they had no
administrative or relationship with or operational control over [2].

> I presume you use a recent curl with OpenSSL?

cURL and OpenSSL are provided by Fedora 31.

$ openssl version
OpenSSL 1.1.1d FIPS 10 Sep 2019

$ curl --version
curl 7.66.0 (x86_64-redhat-linux-gnu) libcurl/7.66.0 OpenSSL/1.1.1d-fips ...

> I don't quite understand your remark on needing X509_V_FLAG_PARTIAL_CHAIN. Are
> you not using a full "chain" ?

No. I'm only using the Let's Encrypt X3 ca certificate. I only use the
CA needed for the end entity certificate at hand.

I don't want the CA Zoo. I [almost] never use it.

I attached the reproducer (for me).

[1] Pastebin with the bad cert from Diginotar:

Sadly, the post from the kid from Iran who blew the lid off Diginotar
is no longer available at [0]. The Google Webmaster deleted his post
(what a fucking idiot, given the historical significance). I have a
copy on it in my inbox. I emailed the text of the post and URL to
myself before the geniuses at Google deleted it.


Here's some output using CURLOPT_VERBOSE.

$ ./test.exe
* Trying
* Connected to ( port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: ./letsencrypt-ca.pem
  CApath: none
* SSL certificate problem: unable to get issuer certificate
* Closing connection 0
Error 60, SSL peer certificate or SSH remote key was not OK.


Here's an ldd on the test executable.

$ ldd test.exe (0x00007ffcee5ef000) => /lib64/ (0x00007f79aee55000) => /lib64/ (0x00007f79aed3b000) => /lib64/ (0x00007f79aed30000) => /lib64/ (0x00007f79aed29000) => /lib64/ (0x00007f79aed07000) => /lib64/ (0x00007f79aeb3e000) => /lib64/ (0x00007f79aeb13000) => /lib64/ (0x00007f79aeaf1000) => /lib64/ (0x00007f79aea81000) => /lib64/ (0x00007f79aea6e000) => /lib64/ (0x00007f79ae9d8000) => /lib64/ (0x00007f79ae6f8000) => /lib64/ (0x00007f79ae6a4000) => /lib64/ (0x00007f79ae5b3000) => /lib64/ (0x00007f79ae59a000) => /lib64/ (0x00007f79ae593000) => /lib64/ (0x00007f79ae542000) => /lib64/ (0x00007f79ae531000) => /lib64/ (0x00007f79ae520000) => /lib64/ (0x00007f79ae506000) => /lib64/ (0x00007f79ae3c0000)
        /lib64/ (0x00007f79aef01000) => /lib64/ (0x00007f79ae23c000) => /lib64/ (0x00007f79ae22a000) => /lib64/ (0x00007f79ae221000) => /lib64/ (0x00007f79ae208000) => /lib64/ (0x00007f79ae1e8000) => /lib64/ (0x00007f79ae1c5000) => /lib64/ (0x00007f79ae198000) => /lib64/ (0x00007f79ae15b000) => /lib64/ (0x00007f79ae0cd000)


  • text/x-c-code attachment: test.c
Received on 2019-11-29