# Elasticsearch SSL Configuration with existing certificate

**URL:** <https://discuss.elastic.co/t/elasticsearch-ssl-configuration-with-existing-certificate/271589>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [April 29, 2021, 5:56am UTC](https://discuss.elastic.co/t/elasticsearch-ssl-configuration-with-existing-certificate/271589 "2021-04-29T05:56:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rknd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rknd/32/103882_2.png) [@rknd](https://discuss.elastic.co/u/rknd)\
**Post date:** [April 29, 2021, 5:56am UTC](https://discuss.elastic.co/t/elasticsearch-ssl-configuration-with-existing-certificate/271589/1 "2021-04-29T05:56:35Z")

</div>

I'm trying to use my own **company.cer** file for elasticsearch's ssl configuration.

However, I've failed with some cases.

**The first case,** I use cer extension of the certificate file in below configuration

```auto
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

xpack.security.http.ssl.certificate: company.cer 
xpack.security.http.ssl.certificate_authorities: company.cer 

xpack.security.transport.ssl.certificate: company.cer 
xpack.security.transport.ssl.certificate_authorities: company.cer 

```

**The second case** I have tried with pfx,

```auto
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: company.pfx
xpack.security.transport.ssl.truststore.path: company.pfx
xpack.security.transport.ssl.keystore.password: password
xpack.security.transport.ssl.truststore.password: password
xpack.security.http.ssl.keystore.password: password
xpack.security.http.ssl.truststore.password: password

```

The password is the **password of pfx** file. But this configuration didn't worked.

**Then, I have tried generating** crt, key files via **OpenSSL** [From This Link](https://gist.github.com/mediaupstream/a2694859b1afa59f26be5e8f6fd4806a) with following configuration.

```auto
xpack.security.enabled: true
xpack.security.http.ssl.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.http.ssl.key: company.key
xpack.security.http.ssl.certificate: company.crt
xpack.security.http.ssl.certificate_authorities: company.crt
xpack.security.transport.ssl.key: company.key
xpack.security.transport.ssl.certificate: company.crt
xpack.security.transport.ssl.certificate_authorities: company.crt

```

How can i configure Elasticsearch SSL from **cer** or **pfx** file ?

Thanks for answering

---

<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 27, 2021, 5:57am UTC](https://discuss.elastic.co/t/elasticsearch-ssl-configuration-with-existing-certificate/271589/2 "2021-05-27T05:57:21Z")

</div>

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