# Letsencrypt SSL root cert problems

**URL:** <https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379>\
**Category:** Build Environment\
**Created:** [September 30, 2021, 4:09pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379 "2021-09-30T16:09:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![perbergland](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/perbergland/32/22313_2.png) [@perbergland](https://discuss.circleci.com/u/perbergland)\
**Post date:** [September 30, 2021, 4:10pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/1 "2021-09-30T16:10:00Z")

</div>

We’re experiencing a blocking issue with at least one letsencrypt cert because its root cert seems to have expired as of today in docker images published by circleci and an apt-get update does not help.

The issue manifests itself when executing:  
curl [https://install.meteor.com](https://install.meteor.com)

in a docker container using circleci/node:14.17.6-stretch

The error is:

SSL certificate problem: certificate has expired

The cert itself is fine, but after reading these articles I suspect the root cause is the switch of root certs for letsencrypt:

> [@cURL Certificate Problem - server certificate verification failed](https://discuss.circleci.com/t/curl-certificate-problem-server-certificate-verification-failed/36211):
>
> If your build uses curl with HTTPS urls, you might have started to encounter an error. If so, it may look something like this: curl: (60) SSL certificate problem: certificate has expired 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 us…

> **[Let's Encrypt issues new Root and Intermediate Certificates](https://scotthelme.co.uk/lets-encrypts-new-root-and-intermediate-certificates/)**
>
> Let's Encrypt have just issued a bunch of new certificates including a new Root
> and several Intermediates. These will bring some significant advantages so let's
> dive in and take a look at what's coming!
> 
> 
> 
> A blog of two halves
> I've been following...

I also tried updating the root certs with  
`sudo apt-get update && sudo apt-get install -y ca-certificates`  
but that did not help

What can I do? Builds are now failing every time…

---

<div class="post-metadata">

**Author:** ![FelicianoTech](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/felicianotech/32/21348_2.png) [@FelicianoTech](https://discuss.circleci.com/u/FelicianoTech)\
**Post date:** [September 30, 2021, 4:33pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/2 "2021-09-30T16:33:46Z")

</div>

You’re using a “stretch” image, which is old.

My first suggestion is to switch to the next-gen CircleCI Node.js image. So instead of `circleci/node:14.17.6-stretch` you would use `cimg/node:14.17.6`. You’re using a legacy image which will be deprecated in a couple months.

If you must stick with the legacy image, I’d try swapping out “stretch” for something newer such as “buster” and see if that helps. It’s a newer Debian base and so may have a newer SSL/TLS package that contains the new Let’s Encrypt root cert.

---

<div class="post-metadata">

**Author:** ![MrMMorris](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mrmmorris/32/12404_2.png) [@MrMMorris](https://discuss.circleci.com/u/MrMMorris)\
**Post date:** [September 30, 2021, 10:35pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/3 "2021-09-30T22:35:49Z")

</div>

just FYI @FelicianoTech, this issue is happening on the default VM image. I was able to fix it by editing `/etc/ca-certificates.conf` and removing `DST_Root_CA_X3.pem`. I then tried running `update-ca-certificates` but that didn’t remove the certs. I had to run `dpkg-reconfigure ca-certificates` and then choosing ‘yes’ and then ‘ok’. Hopefully this gets resolved quickly as it breaks curl interacting with Lets Encrypt endpoints

---

<div class="post-metadata">

**Author:** ![mroch](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mroch/32/10603_2.png) [@mroch](https://discuss.circleci.com/u/mroch)\
**Post date:** [October 1, 2021, 12:55pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/4 "2021-10-01T12:55:23Z")

</div>

this also appears to be happening on macOS:

[https://app.circleci.com/pipelines/github/facebook/flow/2973/workflows/d45aade4-9b98-49a9-b5b4-a240bf4eec1e/jobs/55415](https://app.circleci.com/pipelines/github/facebook/flow/2973/workflows/d45aade4-9b98-49a9-b5b4-a240bf4eec1e/jobs/55415)

[opam.ocaml.org](http://opam.ocaml.org) is using ISRG Root X1 (letsencrypt)

---

<div class="post-metadata">

**Author:** ![mroch](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/mroch/32/10603_2.png) [@mroch](https://discuss.circleci.com/u/mroch)\
**Post date:** [October 1, 2021, 6:24pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/5 "2021-10-01T18:24:01Z")

</div>

@MrMMorris i’m working around this by using a `.curlrc` with `cacert /path/to/cacert.pem`, where cacert.pem is an updated bundle from [curl - Extract CA Certs from Mozilla](https://curl.se/docs/caextract.html)

> <https://github.com/facebook/flow/pull/8757>
>
> Circle's Mac image appears to have outdated SSL certs, such that trying to downl…oad from letsencrypt sites like https://opam.ocaml.org fails.
> 
> letsencrypt's old root cert, DST Root CA X3, expired yesterday. my understanding is that the new root, ISRG Root X1, is cross-signed by the old one, so if the old one is still around then curl errors because it's expired. one fix is to delete the old root, so the new root becomes self-signed. but I don't want to try to mess with macOS's keychain.
> 
> as a simpler temporary fix, I'm just vendoring an updated certificate bundle from https://curl.se/docs/caextract.html (the 2021-09-30 build)

---

<div class="post-metadata">

**Author:** ![Tastafur21](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@Tastafur21](https://discuss.circleci.com/u/Tastafur21)\
**Post date:** [October 5, 2021, 10:00am UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/6 "2021-10-05T10:00:35Z")

</div>

I am having the same problem with curls to ibm, example

curl -f [https://download.clis.cloud.ibm.com/ibm-cloud-cli-metadata/info.json](https://download.clis.cloud.ibm.com/ibm-cloud-cli-metadata/info.json)

curl: (60) SSL certificate problem: certificate has expired

More details here: [curl - SSL CA Certificates](https://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.

---

<div class="post-metadata">

**Author:** ![elousiv](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/elousiv/32/28300_2.png) [@elousiv](https://discuss.circleci.com/u/elousiv)\
**Post date:** [October 5, 2021, 7:11pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/7 "2021-10-05T19:11:19Z")

</div>

@FelicianoTech any updates on this? This is also breaking go modules within our pipeline due to gopkg.in using lets encrypt. See this reddit thread for more information.

Any help you can provide would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![kisielk](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/kisielk/32/28301_2.png) [@kisielk](https://discuss.circleci.com/u/kisielk)\
**Post date:** [October 5, 2021, 8:55pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/8 "2021-10-05T20:55:02Z")

</div>

I was able to fix this on macOS by bumping my XCode version up to 12.5, which I guess uses an image with more recent root certs.

---

<div class="post-metadata">

**Author:** ![estahn](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/estahn/32/13762_2.png) [@estahn](https://discuss.circleci.com/u/estahn)\
**Post date:** [October 6, 2021, 10:56am UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/9 "2021-10-06T10:56:55Z")

</div>

Use an up-to-date image **or** run `apt-get update && apt-get upgrade -y`.

---

<div class="post-metadata">

**Author:** ![bytesguy](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bytesguy](https://discuss.circleci.com/u/bytesguy)\
**Post date:** [October 6, 2021, 4:40pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/10 "2021-10-06T16:40:13Z")

</div>

Yes, this only affects Catalina based images and lower. Big Sur images (Xcode 12.5 and above) are unaffected by this.

I did a little write up on this with a solution for older macOS versions:

> **[Resolving Let's Encrypt Issues with CURL on macOS](https://blog.bytesguy.com/resolving-lets-encrypt-issues-with-curl-on-macos)**
>
> For macOS 10.15 and below

Meanwhile, we are looking at how we can fix this without end-user intervention.

---

<div class="post-metadata">

**Author:** ![gsantner](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/gsantner/32/28744_2.png) [@gsantner](https://discuss.circleci.com/u/gsantner)\
**Post date:** [November 26, 2021, 4:23pm UTC](https://discuss.circleci.com/t/letsencrypt-ssl-root-cert-problems/41379/11 "2021-11-26T16:23:37Z")

</div>

I tried all suggested solutions on CircleCI macOS executors.  
However none of them worked, SSL errors all over the place still.  
So looked up where the CAs are loaded from effectively:

 ![grafik](https://global.discourse-cdn.com/circleci/original/3X/0/3/03dd926b227dda07aaddb803523e855604683175.png)

Then added a command step to CircleCI config that downloads from curl\_se and replaces the pem @ system `/usr/local/etc/openssl/cert.pem` .  
Now it works as expected again and I can connect to my domains who use Let’s encrypt.

> @bytesguy  
> Meanwhile, we are looking at how we can fix this without end-user intervention.

Maybe providing a proper/fixed file at `/usr/local/etc/openssl/cert.pem` by default is what you looking for?

* * *

Hope it is helpful to somebody.  
BTW: I tried all kinds of available CircleCI MacOS versions (circleci config xcode: tag) and none resolved the issue. (As the suggestion was to “use Xcode 12.5”)
