Good Day All.
I have setup a 2-node cluster ith Elasticsearch and kibana.
I took me quite some time on how to get lets-encrypt real certs to work.
The cert now seems to be ok with kibana and Elasticsearch communication.
However, when I installed Metric beat on a server I got this error in the logs which then required me to do more testing
Error dialing x509: certificate signed by unknown authority","service.name":"metricbeat","network":"tcp","address":"elastic1.atstech.co.za:9200","ecs.version":"1.6.0"}
So I found this odd as when I got to https ://elastic1:9200 from firefox I see a verified cert
Then I ran this in curl.
curl -v https: /elastic1<canpoint a link here>:9200
* Trying 102.141.211.65:9200...
* Connected to elastic1<cant point a link here> (102.141.211.65) port 9200 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* CAfile: /etc/ssl/certs/ca-certificates.crt
* CApath: /etc/ssl/certs
* TLSv1.0 (OUT), TLS header, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS header, Finished (20):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (OUT), TLS header, Unknown (21):
* TLSv1.3 (OUT), TLS alert, unknown CA (560):
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here:
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
So this makes no sense so I assume I'm doing something wrong.
Here is my section of config for the certs.
xpack.security.http.ssl:
enabled: true
verification_mode: certificate
key: /etc/elasticsearch/ssl/elastic1.atstech.co.za/privkey1.pem
certificate: /etc/elasticsearch/ssl/elastic1.atstech.co.za/cert1.pem
#keystore.path: certs/http.p12
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
key: /etc/elasticsearch/ssl/elastic1.atstech.co.za/privkey1.pem
certificate: /etc/elasticsearch/ssl/elastic1.atstech.co.za/cert1.pem
certificate_authorities: /etc/elasticsearch/ssl/elastic1.atstech.co.za/fullchain1.pem
#keystore.path: certs/transport.p12
#truststore.path: certs/transport.p12
And here are the steps I filled to generate the certs
snap install certbot --classic
certbot certonly -d elastic1.atstech.co.za
===
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/elastic1.atstech.co.za/fullchain.pem
Key is saved at: /etc/letsencrypt/live/elastic1.atstech.co.za/privkey.pem
===
#note the archive in belwo command
mkdir /etc/elasticsearch/ssl
rsync -avz /etc/letsencrypt/archive/elastic1.atstech.co.za /etc/elasticsearch/ssl/
chmod 750 /etc/elasticsearch/ssl/elastic1.atstech.co.za
chmod 640 /etc/elasticsearch/ssl/elastic1.atstech.co.za/*
chown -R root:elasticsearch /etc/elasticsearch/ssl/elastic1.atstech.co.za
mkdir /etc/kibana/ssl
rsync -avz /etc/letsencrypt/archive/elastic1.atstech.co.za /etc/kibana/ssl/
chmod 750 /etc/kibana/ssl/elastic1.atstech.co.za
chmod 640 /etc/kibana/ssl/elastic1.atstech.co.za/*
chown -R root:kibana /etc/kibana/ssl/elastic1.atstech.co.za
Any help would be greatly appreciated.
Regards