I’m trying to connect over HTTPS to my ElasticSearch deploy on Google Cloud Platform.
I created Virtual Machine with allow to HTTP and HTTPS traffic with default network and firewall rule (ingress, IP range 0.0.0.0/0, exposed ports tcp:9200).
Then I installed ES on my VM, change in elasticsearch.yml my host to 0.0.0.0.
(As described here: https://dzone.com/articles/elastic-search-on-google-cloud-platform)
I’m trying to connect to it using python client as follows:
from elasticsearch import Elasticsearch
es_client = Elasticsearch('https://{vm_external_ip}:9200',
basic_auth=('elastic', {password}),
ca_certs=cert_path)
where cert_path is path to certificate from /elasticsearch/certs/.
And I’m receiving an error:
elastic_transport.TlsError: TLS error caused by: TlsError(TLS error caused by: SSLError(hostname {vm_external_ip} doesn’t match either of ‘elasticsearch’, ‘0:0:0:0:0:0:0:1’, ‘127.0.0.1’, ‘{vm_internal_ip}’, ‘localhost’))
Is there a way to connect over HTTPS using python client to ES deployed on GCP VM via its external ip?
Best regards!