<p>I have a k8s cluster with an ingress nginx as a reverse proxy. I am using letsencrypt to generate TLS certificate</p>
<pre><code>apiVersion: cert-manager.io/v1alpha2
kind: ClusterIssuer
metadata:
  name: letsencrypt
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: ******
    privateKeySecretRef:
      name: letsencrypt
    solvers:
    - http01:
        ingress:
          class: nginx
</code></pre>
<p>Everything worked fine for months. Today,</p>
<pre><code>$ curl -v --verbose https://myurl
</code></pre>
<p>returns</p>
<pre><code>* Rebuilt URL to: https://myurl/
*   Trying 51.103.58.**...
* TCP_NODELAY set
* Connected to myurl (51.103.58.**) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* 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 (OUT), TLS alert, Server hello (2):
* SSL certificate problem: certificate has expired
* stopped the pause stream!
* Closing connection 0
curl: (60) SSL certificate problem: certificate has expired
More details here: https://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a &quot;bundle&quot;
 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.
HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure.
</code></pre>
<p>For 2 other people on my team, error is the same and I have the same error when I use Postman (expired certificate).</p>
<p>But for another one, we get no error :</p>
<pre><code>*   Trying 51.103.58.**...
* TCP_NODELAY set
* Connected to myurl (51.103.58.**) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* 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, 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 change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=myurl
*  start date: Jul 24 07:15:13 2021 GMT
*  expire date: Oct 22 07:15:11 2021 GMT
*  subjectAltName: host &quot;myurl&quot; matched cert's &quot;myurl&quot;
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fd9be00d600)
&gt; GET / HTTP/2
&gt; Host: myurl
&gt; User-Agent: curl/7.64.1
&gt; Accept: */*
&gt;
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
&lt; HTTP/2 200
&lt; server: nginx/1.19.1
&lt; date: Thu, 30 Sep 2021 16:11:23 GMT
&lt; content-type: application/json; charset=utf-8
&lt; content-length: 56
&lt; vary: Origin, Accept-Encoding
&lt; access-control-allow-credentials: true
&lt; x-xss-protection: 1; mode=block
&lt; x-frame-options: DENY
&lt; strict-transport-security: max-age=15724800; includeSubDomains
&lt; x-download-options: noopen
&lt; x-content-type-options: nosniff
&lt; etag: W/&quot;38-3eQD3G7Y0vTkrLR+ExD2u5BSsMc&quot;
&lt;
* Connection #0 to host myurl left intact
{&quot;started&quot;:&quot;2021-09-30T13:30:30.912Z&quot;,&quot;uptime&quot;:9653.048}* Closing connection 0
</code></pre>
<p>When I use my web browser to go to the website, everything works fine and the certificate is presented as valid and for now, I get no error in prod or staging environment. (same error on staging)</p>
<p>Has anyone an explanation on this ?</p>

<p><em>Warning! Please plan OS upgrade path. The below advice should be applied only in emergency situation to quickly fix a critical system.</em></p>
<p>Your team missed OS update or <code>ca-certificates</code> package update.
Below solution works on old Debian/Ubuntu systems.</p>
<p>First check if you have offending DST Root CA X3 cert present:</p>
<pre><code># grep X3 /etc/ca-certificates.conf 
mozilla/DST_Root_CA_X3.crt
</code></pre>
<p>Make sure the client OS have the proper ISRG Root X1 present too:</p>
<pre><code># grep X1 /etc/ca-certificates.conf 
mozilla/ISRG_Root_X1.crt
</code></pre>
<p>This is going to disable X3:</p>
<pre><code># sed -i '/^mozilla\/DST_Root_CA_X3/s/^/!/' /etc/ca-certificates.conf &amp;&amp; update-ca-certificates -f
</code></pre>
<p>Try <code>curl https://yourdomain</code> now, should pass.</p>
<p>Again, plan an upgrade please.</p>
