But when I was using python to connect. I download the cert from Cloud UI->platform->Settings and saved as "cloud_certs"
Then use the following code to connect.
Note that the hostname you're using ends with 172.31.63.51.ip.es.io. The ip.es.io domain is a "magic" domain name managed by Elastic, that provides wildcard DNS for any IP address. So in your case, 172.31.63.51.ip.es.io will simply resolve to 172.31.63.51. We use this solution to save the need for users to define their own wildcard DNS record while evaluating ECE. In a production setup, you probably don't want to rely on this service, and we recommend that you have your own wildcard DNS name that resolves to one of the ECE proxy hosts or a load balancer that fronts them.
In this specific case, for this to work properly you need to make sure that:
The host which runs your Python code has internet access (so it can access ip.es.io).
The IP adderss 172.31.63.51 resolves from that same host.
Can you try connecting over :9200 first? Eg open :9200 in the firewall and connect to http://3be9c7613c08413e8bc755802b107e6a.172.31.63.51.ip.es.io:9200 first via curl and then with a similar python snippet.
That will take certification issues out the way, and also importantly, if the connection to 9200 fails you can use tcpdump to diagnose what's going on.
(You might also be able to get more information by upping the logging level:
That really resolve my problem. Becuase we are using ECE as an internal service. So using port 9200 will facilitate a lot for our work rather than using port 9243.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.