ElasticSearch Connect Exception

In our case we were using an older version of Elasticsearch and are only going for 7.3.0. The server port is listening to both 9200/9300. The curl script response for curl -XGET "localhost:9200/_cluster/health?pretty" is:

{
"cluster_name" : "dummy_cluster_name,
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 56,
"active_shards" : 56,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 56,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 50.0
}

If I try to connect using port 9300, i get an exception that the port is not a http port.

For 9200, i get an connection timeout.