Elasticsearch

Where are trying this command?

Can you provide more context about this? Are you on Windows? This looks like an error from PowerShell.

If I'm not wrong this is not really curl, it is an alias in PowerShell to Invoke-WebRequest, so your curl command will not work as expected for a Linux system.

Your error does not seem to be related to Elasticsearch, try to open https://localhost:9200 on a web browser to test the connection.