# SSL certs in Java

**URL:** <https://community.letsencrypt.org/t/ssl-certs-in-java/15450>\
**Category:** Uncategorized\
**Created:** [May 7, 2016, 10:21pm UTC](https://community.letsencrypt.org/t/ssl-certs-in-java/15450 "2016-05-07T22:21:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoedyGreen](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/roedygreen/32/7214_2.png) [@RoedyGreen](https://community.letsencrypt.org/u/RoedyGreen)\
**Post date:** [May 7, 2016, 10:21pm UTC](https://community.letsencrypt.org/t/ssl-certs-in-java/15450/1 "2016-05-07T22:21:34Z")

</div>

What is the trick to making your SSL certs work with Java clients? I have  
imported all your root and intermediate certs into cacerts. I get a  
complaint about being unable to find cert chain.

This works for other vendors.

---

<div class="post-metadata">

**Author:** ![pfg](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/pfg/32/1924_2.png) [@pfg](https://community.letsencrypt.org/u/pfg)\
**Post date:** [May 7, 2016, 11:01pm UTC](https://community.letsencrypt.org/t/ssl-certs-in-java/15450/2 "2016-05-07T23:01:49Z")

</div>

The ISRG root certificate and the IdenTrust X3 root certificate (used via cross-signing) are currently not included in the Java root program. You can use [this script](https://gist.github.com/Firefishy/109b0f1a90156f6c933a50fe40aa777e) to do that manually. Make sure that your server is also sending the intermediate certificate, otherwise the client might not be able to build the trust chain back to the root certificate. This can be verified using [SSL Labs](https://www.ssllabs.com/ssltest/) or by using `openssl s_client -showcerts -connect example.com:443` and manually inspecting the output.

---

<div class="post-metadata">

**Author:** ![tanmaig](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tanmaig](https://community.letsencrypt.org/u/tanmaig)\
**Post date:** [October 19, 2016, 8:10am UTC](https://community.letsencrypt.org/t/ssl-certs-in-java/15450/3 "2016-10-19T08:10:36Z")

</div>

@pfg Thanks! This works well. Do you know of equivalent reference for windows?

---

<div class="post-metadata">

**Author:** ![pfg](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/pfg/32/1924_2.png) [@pfg](https://community.letsencrypt.org/u/pfg)\
**Post date:** [October 19, 2016, 8:38am UTC](https://community.letsencrypt.org/t/ssl-certs-in-java/15450/4 "2016-10-19T08:38:44Z")

</div>

Haven’t seen a Windows version of this. The `keytool` syntax should be the same on Windows (other than the `2> /dev/null || true` bit), so you’d probably only have to worry about how you fetch the certificates (the `wget` lines) and possibly change some of the paths.

If you’re able to upgrade to the latest version of Java, that would work too, as Java now trusts the root certificate Let’s Encrypt chains up to.

---

<div class="post-metadata">

**Author:** ![ahaw021](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/ahaw021/32/14882_2.png) [@ahaw021](https://community.letsencrypt.org/u/ahaw021)\
**Post date:** [October 19, 2016, 10:07am UTC](https://community.letsencrypt.org/t/ssl-certs-in-java/15450/5 "2016-10-19T10:07:19Z")

</div>

hi tanmaig

the quivalent in windows is the PFX format.

You should export a .PEM certificate with intermediates and private key into a .pfx file

Windows will then install the cert into the personal store and the intermediate cert into the Trusted Intermediate Store.

An alternative is to download the Intermediate certificates and install them into the windows Trusted Intermediate Store.

 ![](https://global.discourse-cdn.com/letsencrypt/original/2X/2/2db13ebb404dabbc9e3e90d236525b729e4e2506.PNG) ![](https://global.discourse-cdn.com/letsencrypt/original/2X/9/922f06d32edfe1571d7c2b47b5645f8f2ac864ed.PNG)

---

<div class="post-metadata">

**Author:** ![tanmaig](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@tanmaig](https://community.letsencrypt.org/u/tanmaig)\
**Post date:** [October 19, 2016, 10:37am UTC](https://community.letsencrypt.org/t/ssl-certs-in-java/15450/6 "2016-10-19T10:37:39Z")

</div>

Did that. 🙂 I can confirm that it works perfectly.

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/mnordhoff/32/22583_2.png) [@mnordhoff](https://community.letsencrypt.org/u/mnordhoff)\
**Post date:** [October 20, 2016, 1:50am UTC](https://community.letsencrypt.org/t/ssl-certs-in-java/15450/7 "2016-10-20T01:50:04Z")

</div>

IdenTrust's DST Root CA X3 was actually added to Java's trust store since this thread was started.

> Java: only works with 7u111+ and 8u101+ as the "DST Root CA X3" was added with these versions on 2016-07-19 (see [OpenJDK Log In](https://bugs.openjdk.java.net/browse/JDK-8154757101))

> [@Which browsers and operating systems support Let's Encrypt](https://community.letsencrypt.org/t/which-browsers-and-operating-systems-support-lets-encrypt/4394):
>
> T…

Edit: I missed the line where pfg said this 18 hours ago. ☹
