DEV Community

Ali Mahdiyanjoo
Ali Mahdiyanjoo

Posted on

Updating Elasticsearch with P12 Certificate

๐Ÿ” Background:

For updating Elasticsearch to versions 17.10 and 17.5 with a P12 certificate, you can follow the steps outlined below.

Steps:

  1. Access Docker Container:
docker exec -it {container_name} bash
Enter fullscreen mode Exit fullscreen mode
  1. Generate CA Certificate:
/usr/share/elasticsearch/bin/elasticsearch-certutil ca
Enter fullscreen mode Exit fullscreen mode
  • Enter a file name for the CA certificate in P12 format (e.g., New_Cer.p12)
  • Specify the cipher for SSL encryption.
  1. Sign the new Certificate:
/usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca {First_created_file}.p12 --ca-pass "" --days {Date_Of_Expiration} --out "{Output_name}.p12" --pass ""
Enter fullscreen mode Exit fullscreen mode
  1. Replace SSL Certificate:
rm -rf /usr/share/elasticsearch/config/cert/elastic-stack-ca.p12
Enter fullscreen mode Exit fullscreen mode
mv {Location_Of_Created_File} /usr/share/elasticsearch/config/cert/elastic-stack-ca.p12
Enter fullscreen mode Exit fullscreen mode
  1. Update File Permissions:
sudo chown {Username}:{Group} /usr/share/elasticsearch/config/cert/elastic-stack-ca.p12
Enter fullscreen mode Exit fullscreen mode
  1. Check SSL Validation:
  • Dev Tool in Kibana:
GET /_ssl/certificates
Enter fullscreen mode Exit fullscreen mode
  • Check SSL Expiry Date:
curl -X GET http://{IP_Address}:9200/_ssl/certificates -u {Username}:{Password} | jq '.[-1].expiry' | cut -d '"' -f 2
Enter fullscreen mode Exit fullscreen mode

๐Ÿš€ Completion:

By following these steps, you would have successfully updated Elasticsearch to the specified versions and configured it with a P12 certificate for secure communication.

Good luck with your Elasticsearch update! ๐ŸŽ‰

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Sentry image

See why 4M developers consider Sentry, โ€œnot bad.โ€

Fixing code doesnโ€™t have to be the worst part of your day. Learn how Sentry can help.

Learn more

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay