# Lets encrypt server certificate verification failed

**URL:** <https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466>\
**Category:** Using Jenkins\
**Created:** [October 4, 2021, 6:48am UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466 "2021-10-04T06:48:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![avshimo](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@avshimo](https://community.jenkins.io/u/avshimo)\
**Post date:** [October 4, 2021, 6:48am UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/1 "2021-10-04T06:48:32Z")

</div>

Hi, we’re using Jenkins pod with slave pods (as cloud w/kubernetes pluging) .  
our Git repo is Atlassian BitBucket signed with Let’s encrypt SSL .  
As of last week , due to change by Let’s encrypt , our Jenkins cannot access BB repos and throws error,  
**server certificate verification failed. CAfile: none CRLfile: none**.  
According to Lets Encrypt web site, one needs to update CA trust files in running OS.  
Since we’re using Jenkins POD . we cannot update container OS . tried to upgrade jenkins pod to Latest version (using Helm) but It didnt help .  
So now our R&D are stuck .  
Urgent Help needed . Thanks

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [October 4, 2021, 7:28am UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/2 "2021-10-04T07:28:31Z")

</div>

Which docker image are you using? I’m pretty sure the newer ones should be fine, but if your using a older one you’ll probably have to extend it, switch to root, update certs then switch back to Jenkins.

[Docker image updates](https://www.jenkins.io/blog/2021/02/08/docker-base-os-upgrade/#docker-image-with-subversion) shows how to extend any image you want

---

<div class="post-metadata">

**Author:** ![halkeye](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/halkeye/32/8_2.png) [@halkeye](https://community.jenkins.io/u/halkeye)\
**Post date:** [October 4, 2021, 7:29am UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/3 "2021-10-04T07:29:25Z")

</div>

Reminder, please use the term agent instead of slave. Slave has been removed for years now.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [October 4, 2021, 12:24pm UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/4 "2021-10-04T12:24:15Z")

</div>

In the past, an outdated Java version seemed to be associated with SSL certificate recognition failures.

As @halkeye noted, if you’re running the current versions of the Docker images, you’ll have a current Java version and a current operating system version. If you’re not running the current versions of the Docker images, you’ll benefit from updating to the current versions.

---

<div class="post-metadata">

**Author:** ![igors](https://avatars.discourse-cdn.com/v4/letter/i/4bbf92/32.png) [@igors](https://community.jenkins.io/u/igors)\
**Post date:** [December 17, 2021, 7:11am UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/5 "2021-12-17T07:11:10Z")

</div>

I got this issue as well, plugins will not update.  
There were errors checking the update sites: SSLHandshakeException: Remote host terminated the handshake  
java.io.EOFException: SSL peer shut down incorrectly  
Caused: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake  
Caused: javax.net.ssl.SSLHandshakeException: Remote host terminated the handshake  
Caused: java.io.IOException: Failed to load updates jenkins io download/plugins/stashNotifier/1.24/stashNotifier.hpi to /opt/jenkins/home/plugins/stashNotifier.jpi.tmp  
Caused: java.io.IOException: Failed to download from updates jenkins io download/plugins/stashNotifier/1.24/stashNotifier.hpi (redirected to: get jenkins io plugins/stashNotifier/1.24/stashNotifier.hpi)

So am I thinking in right direction, that this is because of cacerts keystore containing expired root cert?  
Updating java should include more recent keystore without this issue then?

Can someone confirm this?

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [December 17, 2021, 12:56pm UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/6 "2021-12-17T12:56:37Z")

</div>

> [@igors](#):
>
> So am I thinking in right direction, that this is because of cacerts keystore containing expired root cert?  
> Updating java should include more recent keystore without this issue then?
> 
> Can someone confirm this?

Yes, that’s been the technique used by others.

---

<div class="post-metadata">

**Author:** ![igors](https://avatars.discourse-cdn.com/v4/letter/i/4bbf92/32.png) [@igors](https://community.jenkins.io/u/igors)\
**Post date:** [December 28, 2021, 7:01pm UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/7 "2021-12-28T19:01:57Z")

</div>

I am still facing same issue after java update.  
checked cacerts included with openjdk 11.0.13, it contains x1 root certificate, even added R3 intermediate from the chain, did not help.  
Is jenkins using cacerts from java, that starts the process?

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [December 29, 2021, 1:51am UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/8 "2021-12-29T01:51:49Z")

</div>

> [@igors](#):
>
> Is jenkins using cacerts from java, that starts the process?

Yes, Jenkins relies on Java for the CA certificates. Jenkins uses Java. Java uses the CA certificates. If your operating system provides the CA certificates as a separate package (many do that), then you need to assure that the operating system CA certificates package has been updated.

---

<div class="post-metadata">

**Author:** ![igors](https://avatars.discourse-cdn.com/v4/letter/i/4bbf92/32.png) [@igors](https://community.jenkins.io/u/igors)\
**Post date:** [December 30, 2021, 12:13pm UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/9 "2021-12-30T12:13:48Z")

</div>

For the test on my VM I removed x1 root cert form cacerts and got different error - sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target  
Issue still remains with SSLHandshakeException: Remote host terminated the handshake.  
Finally managed to track down difference in environments - they are in different geographical locations and there are multiple redirects [updates.jenkins.io](http://updates.jenkins.io) to [get.jenkins.io](http://get.jenkins.io) to some mirror close to physical location of the machine and those are different mirrors. And it seems, that remote host is that mirror that refuses connection.

---

<div class="post-metadata">

**Author:** ![igors](https://avatars.discourse-cdn.com/v4/letter/i/4bbf92/32.png) [@igors](https://community.jenkins.io/u/igors)\
**Post date:** [December 30, 2021, 1:06pm UTC](https://community.jenkins.io/t/lets-encrypt-server-certificate-verification-failed/466/10 "2021-12-30T13:06:04Z")

</div>

Poking servers with sslpoke reveals that issue seems to be with TLSv1.3  
some mirrors handshake correctly, but few cannot send server side handshake when protocol is not explicitly stated or is 1.3, only one that works all the time is TLSv1.2
