# ERROR: Unable to create an enrollment token. Elasticsearch node HTTP layer SSL configuration Keystore doesn't contain any PrivateKey entries where the associated certificate is a CA certificateociated certificate is a CA certificate

**URL:** https://discuss.elastic.co/t/error-unable-to-create-an-enrollment-token-elasticsearch-node-http-layer-ssl-configuration-keystore-doesnt-contain-any-privatekey-entries-where-the-associated-certificate-is-a-ca-certificateociated-certificate-is-a-ca-certificate/311045
**Category:** Elasticsearch
**Tags:** elastic-stack-security
**Created:** [July 30, 2022, 6:23pm UTC](https://discuss.elastic.co/t/error-unable-to-create-an-enrollment-token-elasticsearch-node-http-layer-ssl-configuration-keystore-doesnt-contain-any-privatekey-entries-where-the-associated-certificate-is-a-ca-certificateociated-certificate-is-a-ca-certificate/311045 "2022-07-30T18:23:50Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![huzaifa224](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/huzaifa224/32/105868_2.png) [@huzaifa224](https://discuss.elastic.co/u/huzaifa224)
#### Post date: [July 30, 2022, 6:23pm UTC](https://discuss.elastic.co/t/error-unable-to-create-an-enrollment-token-elasticsearch-node-http-layer-ssl-configuration-keystore-doesnt-contain-any-privatekey-entries-where-the-associated-certificate-is-a-ca-certificateociated-certificate-is-a-ca-certificate/311045/1 "2022-07-30T18:23:50Z")

</div>

I have installed the elasticsearch and configure the all certificated as mentioned in document but when i tried to generate a token it give the error. However i have already added the Keystore by using the command

> './bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure\_password'

elasticsearch is running fine but its just give the error while i tried to create a token using command

> bin/elasticsearch-create-enrollment-token -s kibana

Here is the my elasticsearch.yml

> path.data: /var/lib/elasticsearch  
> path.logs: /var/log/elasticsearch  
> network.host: 0.0.0.0  
> http.port: 9200  
> discovery.seed\_hosts: ["127.0.0.1", "[::1]"]  
> discovery.type: single-node
> 
> xpack.security.enrollment.enabled: true  
> xpack.license.self\_generated.type: basic  
> xpack.security.http.ssl.enabled: true  
> xpack.security.http.ssl.keystore.path: /etc/elasticsearch/certs/http.p12  
> xpack.security.transport.ssl.enabled: false

Please let me know how can i fix this?

---

<div class="post-metadata">

### Author: ![Yang\_Wang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yang_wang/32/48857_2.png) [@Yang\_Wang](https://discuss.elastic.co/u/Yang_Wang)
#### Post date: [August 2, 2022, 12:29am UTC](https://discuss.elastic.co/t/error-unable-to-create-an-enrollment-token-elasticsearch-node-http-layer-ssl-configuration-keystore-doesnt-contain-any-privatekey-entries-where-the-associated-certificate-is-a-ca-certificateociated-certificate-is-a-ca-certificate/311045/2 "2022-08-02T00:29:52Z")

</div>

> configure the all certificated as mentioned in document

Which document did you follow?

In general, if you choose to manually configure security (e.g. TLS), you can no longer use the security auto-configuration (including enrollment). It may be desirable to make the auto-configuration more flexible in the future so it can work on existing configuration. But for now, you will have to keep configuring manually once you started on that path.

---

<div class="post-metadata">

### Author: ![huzaifa224](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/huzaifa224/32/105868_2.png) [@huzaifa224](https://discuss.elastic.co/u/huzaifa224)
#### Post date: [August 2, 2022, 7:10am UTC](https://discuss.elastic.co/t/error-unable-to-create-an-enrollment-token-elasticsearch-node-http-layer-ssl-configuration-keystore-doesnt-contain-any-privatekey-entries-where-the-associated-certificate-is-a-ca-certificateociated-certificate-is-a-ca-certificate/311045/3 "2022-08-02T07:10:24Z")

</div>

Hi Yang,

I have follow these documents [Set up basic security for the Elastic Stack | Elasticsearch Guide [8.3] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-basic-setup.html)  
[Set up basic security for the Elastic Stack plus secured HTTPS traffic | Elasticsearch Guide [8.3] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-basic-setup-https.html).

I tried the configurations mentioned in above link and every start fine but when i tried to run token generate command bin/elasticsearch-create-enrollment-token -s kibana it give the error.

---

<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: [August 30, 2022, 7:10am UTC](https://discuss.elastic.co/t/error-unable-to-create-an-enrollment-token-elasticsearch-node-http-layer-ssl-configuration-keystore-doesnt-contain-any-privatekey-entries-where-the-associated-certificate-is-a-ca-certificateociated-certificate-is-a-ca-certificate/311045/4 "2022-08-30T07:10:35Z")

</div>

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