# Generate node certificate

**URL:** <https://discuss.elastic.co/t/generate-node-certificate/329951>\
**Category:** Elasticsearch\
**Created:** [April 13, 2023, 8:32pm UTC](https://discuss.elastic.co/t/generate-node-certificate/329951 "2023-04-13T20:32:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 13, 2023, 8:32pm UTC](https://discuss.elastic.co/t/generate-node-certificate/329951/1 "2023-04-13T20:32:57Z")

</div>

What am I doing wrong? missing some option, parameter?

I have my cluster setup with certificate and working fine with following config on all nodes.  
it was created using

`/usr/share/elasticsearch/bin/elasticsearch-certutil cert cert --ca elastic-certificates.p12`

Same as describe in this link  
[https://www.elastic.co/guide/en/elasticsearch/reference/8.6/security-basic-setup.html](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/security-basic-setup.html)

```auto
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /etc/elasticsearch/config/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /etc/elasticsearch/config/elastic-certificates.p12

```

and now when I try to generate certificate for node using ca that I have , it give me this error  
following this - [https://www.elastic.co/guide/en/elasticsearch/reference/8.6/security-basic-setup-https.html](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/security-basic-setup-https.html)

```auto
Exception in thread "main" java.lang.IllegalArgumentException: ca certificate is not a CA!
        at org.elasticsearch.xpack.security.cli.CertGenUtils.generateSignedCertificate(CertGenUtils.java:250)
        at org.elasticsearch.xpack.security.cli.HttpCertificateCommand.writeCertificateAndKeyDetails(HttpCertificateCommand.java:365)
        at org.elasticsearch.xpack.security.cli.HttpCertificateCommand.writeZip(HttpCertificateCommand.java:267)
        at org.elasticsearch.xpack.security.cli.HttpCertificateCommand.execute(HttpCertificateCommand.java:238)
        at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
        at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:94)
        at org.elasticsearch.xpack.security.cli.CertificateTool.execute(CertificateTool.java:160)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
        at org.elasticsearch.cli.Command.main(Command.java:50)
        at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)

```

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 13, 2023, 11:27pm UTC](https://discuss.elastic.co/t/generate-node-certificate/329951/2 "2023-04-13T23:27:00Z")

</div>

> [@elasticforme](#):
>
> /usr/share/elasticsearch/bin/elasticsearch-certutil cert cert

You have `cert` in there teice

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 14, 2023, 1:42pm UTC](https://discuss.elastic.co/t/generate-node-certificate/329951/3 "2023-04-14T13:42:03Z")

</div>

ya that was typo. but that part works.

second part is not

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 14, 2023, 2:47pm UTC](https://discuss.elastic.co/t/generate-node-certificate/329951/4 "2023-04-14T14:47:11Z")

</div>

Can you show the actual commands not just error?

Hard.to help without it.

Can you show the actual commands, the output files and errors in sequence?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 14, 2023, 2:51pm UTC](https://discuss.elastic.co/t/generate-node-certificate/329951/5 "2023-04-14T14:51:02Z")

</div>

Ohh and not sure if another typo

> [@elasticforme](#):
>
> --ca elastic-certificates.p12

That should be  
`--ca elastic-certificate-ca.p12`

Whenever you use the CA flag this or after it has to be the CA. I don't know if that was a typo too

---

<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 12, 2023, 2:51pm UTC](https://discuss.elastic.co/t/generate-node-certificate/329951/6 "2023-05-12T14:51:33Z")

</div>

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