# Using an already existing certificate while installing Mender

**URL:** <https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730>\
**Category:** General Discussions\
**Created:** [June 19, 2019, 9:31am UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730 "2019-06-19T09:31:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bilbol](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bilbol](https://hub.mender.io/u/bilbol)\
**Post date:** [June 19, 2019, 9:31am UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/1 "2019-06-19T09:31:27Z")

</div>

Hello,  
I’m trying to install the open source Mender, and I realized that there is a command that generates keys and certificates. I already have a CA certificate for my domain acquired via Let’s Encrypt, so my question is how/where do I use that certificate, instead of generating a new one? As far as I can see there is no instruction for this in the documentation.  
Thank you for your time.

---

<div class="post-metadata">

**Author:** ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)\
**Post date:** [June 19, 2019, 9:44am UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/2 "2019-06-19T09:44:08Z")

</div>

Welcome to Mender!

AFAIK, you have to mention the certificate under `mender.conf` file only if the certificate is self signed.  
If your certificate is already a CA certificate, then mender will handle it automatically (no need to mention the \*.cert path in this case). Please see [https://docs.mender.io/2.0/artifacts/yocto-project/building-for-production#including-the-client-certificates](https://docs.mender.io/2.0/artifacts/yocto-project/building-for-production#including-the-client-certificates) for more details

BTW, are you using the production version or demo version?

---

<div class="post-metadata">

**Author:** ![bilbol](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bilbol](https://hub.mender.io/u/bilbol)\
**Post date:** [June 19, 2019, 11:51am UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/3 "2019-06-19T11:51:39Z")

</div>

Thank you for the reply!  
I am trying to install the production version. So, as far as I know my certificate is indeed a CA certificate, in this case, should I skip the “CERT\_API\_CN=[mender.example.com](http://mender.example.com) CERT\_STORAGE\_CN=[s3.example.com](http://s3.example.com) …/keygen” prompt? Do I have to include my certificate in some sort of folder in order for Mender to handle it?  
Thanks again for the quick reply!

---

<div class="post-metadata">

**Author:** ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)\
**Post date:** [June 19, 2019, 12:18pm UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/4 "2019-06-19T12:18:47Z")

</div>

Sorry for the confusion, I thought the question is related to the mender client side 🙂

From server perspective, I think you have to use the `keygen` helper script (replacing `mender.example.com` and `s3.example.com` with your DNS names).  
Please see [https://docs.mender.io/2.0/administration/production-installation#certificates-and-keys](https://docs.mender.io/2.0/administration/production-installation#certificates-and-keys)

@mirzak Could you please add your points?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [June 19, 2019, 1:08pm UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/5 "2019-06-19T13:08:14Z")

</div>

I actually do not any additional insight and server side things is not really my forte. But I will ask someone who knows :).

But I do not belive that you want to use the keygen script at all if you have your own certificates

---

<div class="post-metadata">

**Author:** ![bilbol](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bilbol](https://hub.mender.io/u/bilbol)\
**Post date:** [June 19, 2019, 2:01pm UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/6 "2019-06-19T14:01:32Z")

</div>

Then I will try it without the keygen script next time, thank you for your time 🙂 I will also keep an eye on here for further updates, will be glad to know further about this.

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [June 20, 2019, 8:05am UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/7 "2019-06-20T08:05:39Z")

</div>

Actually this page does provide some additional information, maybe that is helpful. It does seem that you need to run `keygen` to generate all the keys that are used for inter service communication.

[https://docs.mender.io/2.0/Administration/Certificates-and-keys](https://docs.mender.io/2.0/Administration/Certificates-and-keys)

---

<div class="post-metadata">

**Author:** ![0lmi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/0lmi/32/133_2.png) [@0lmi](https://hub.mender.io/u/0lmi)\
**Post date:** [June 20, 2019, 9:13am UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/8 "2019-06-20T09:13:13Z")

</div>

@bilbol

If you want to use Let’s encrypt certificates then you need to do the following:

1. use keygen script first to generate all certs and keys
2. issue 2 certificates for [mender.yourdomain.io](http://mender.yourdomain.io) and [storage.yourdomain.io](http://storage.yourdomain.io) if you do such separation
3. replace the certs in keys-generated/certs by the one you have issued

---

<div class="post-metadata">

**Author:** ![bilbol](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@bilbol](https://hub.mender.io/u/bilbol)\
**Post date:** [June 20, 2019, 9:30am UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/9 "2019-06-20T09:30:32Z")

</div>

Okay, will do! Thank you all for your time 🙂

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [June 27, 2019, 11:56am UTC](https://hub.mender.io/t/using-an-already-existing-certificate-while-installing-mender/730/10 "2019-06-27T11:56:24Z")

</div>

Did it work out for you @bilbol, if that is the case maybe we can mark @0lmi response as “solution”
