ElasticSearch Empty Reply From Server Error

In Elasticsearch latest versions, xpack security is enabled by default. To resolve the error "Empty reply from server"

 curl --cacert /etc/elasticsearch/certs/http_ca.crt  https://localhost:9200 -u elastic

You will be prompted for a password. 

If you don't know your password, run following command to setup one...

sudo /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic -i

After you are done setting the password, run the following command again with the password that you set above...

 curl --cacert /etc/elasticsearch/certs/http_ca.crt  https://localhost:9200 -u elastic