# Use a password protected elasticsearch-ca.pem inside kibana.kml

**URL:** https://discuss.elastic.co/t/use-a-password-protected-elasticsearch-ca-pem-inside-kibana-kml/271396
**Category:** Kibana
**Tags:** elastic-stack-security
**Created:** [April 27, 2021, 2:26pm UTC](https://discuss.elastic.co/t/use-a-password-protected-elasticsearch-ca-pem-inside-kibana-kml/271396 "2021-04-27T14:26:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ehsan\_kabiri\_33](https://avatars.discourse-cdn.com/v4/letter/e/b77776/32.png) [@ehsan\_kabiri\_33](https://discuss.elastic.co/u/ehsan_kabiri_33)
#### Post date: [April 27, 2021, 2:26pm UTC](https://discuss.elastic.co/t/use-a-password-protected-elasticsearch-ca-pem-inside-kibana-kml/271396/1 "2021-04-27T14:26:11Z")

</div>

To make communications between Kibana and Elasticsearch be encrypted , I can use one of the followings:

```
elasticsearch.ssl.certificateAuthorities: /etc/kibana/elasticsearch-ca.pem

elasticsearch.ssl.key.path: /etc/kibana/elasticsearch-ca.pem

```

But I have a .pem file which is password protected. But I couldn't find the suitable code/syntax . I tried many things like this but Kibana log nothings on start up, means that the lines bellow are unknown commands:

> elasticsearch.ssl.certificateAuthorities.password:"myPass"  
> elasticsearch.ssl.key.password: "myPass"

What can I do to use a password protected .pem file inside kibana.kml?

---

<div class="post-metadata">

### Author: ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)
#### Post date: [April 28, 2021, 7:45am UTC](https://discuss.elastic.co/t/use-a-password-protected-elasticsearch-ca-pem-inside-kibana-kml/271396/2 "2021-04-28T07:45:55Z")

</div>

> [@ehsan\_kabiri\_33](#):
>
> ```auto
> elasticsearch.ssl.certificateAuthorities: /etc/kibana/elasticsearch-ca.pem
> 
> elasticsearch.ssl.key.path: /etc/kibana/elasticsearch-ca.pem
> 
> ```

Those two configurations are very different.

The `certificateAuthorities` setting indicates which certificate authorities should be trusted when verifying the identity of the ES server.  
The `key` setting provides private key for TLS client authentication.

> [@ehsan\_kabiri\_33](#):
>
> But I have a .pem file which is password protected

Only PEM private keys can be encrypted. It is not possible to have an encrypted certificate (authority). Do you have a private key or a certificate?

---

<div class="post-metadata">

### Author: ![ehsan\_kabiri\_33](https://avatars.discourse-cdn.com/v4/letter/e/b77776/32.png) [@ehsan\_kabiri\_33](https://discuss.elastic.co/u/ehsan_kabiri_33)
#### Post date: [April 28, 2021, 6:05pm UTC](https://discuss.elastic.co/t/use-a-password-protected-elasticsearch-ca-pem-inside-kibana-kml/271396/3 "2021-04-28T18:05:07Z")

</div>

This is how I created my .pem to be used in Kibana.kml. The first two lines are used to generate a CA and generate a certificate and private key for your node

```
./bin/elasticsearch-certutil ca
./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
openssl pkcs12 -in elastic-certificates.p12 -cacerts -nokeys -out elasticsearch-ca.pem -passout pass:123456

```

> This will produce a PEM-formatted file named `elasticsearch-ca.pem` that contains all CA certificates from the PKCS#12 file.

Now I have a .pem file password protected (in documents it has no password). I use this in kibana and also use a copy of it in [my.Net](http://my.Net) core app to be connected securely.

I can add a password to Nest in my app but cant add pass in kibana.kml  
Refrence: [https://www.elastic.co/guide/en/kibana/master/configuring-tls.html](https://www.elastic.co/guide/en/kibana/master/configuring-tls.html)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 26, 2021, 6:05pm UTC](https://discuss.elastic.co/t/use-a-password-protected-elasticsearch-ca-pem-inside-kibana-kml/271396/4 "2021-05-26T18:05:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
