SSL(curl) connection error in ElasticSearch setup

Recieves below error when trying to use 9200 or 9216 on http/s

sudo curl -X GET 'https://localhost:9200'
curl: (7) Failed connect to localhost:9200; Connection refused

sudo curl -X GET 'https://localhost:9216'
curl: (35) Encountered end of file

Error when trying to set password with 9200 is mentioned here: Master_not_discovered_exception error while setting up passwords for user