Use cURL with SNI (Server Name Indication)

Server Name Indication (SNI) is an extension to the Transport Layer Security (TLS) protocol that allows a client to specify the hostname it is trying to connect to at the start of the handshaking process. This is useful when a server is hosting multiple websites on the same IP address, as it allows the server to present the correct SSL/TLS certificate for the hostname the client is trying to reach.

cURL is a command-line tool that can be used to make various types of HTTP requests, including HTTPS requests. By default, cURL will use SNI when making HTTPS requests, so no special options are needed to enable it.

Here is an example of using cURL to make an HTTPS request to a website that uses SNI:

curl https://example.com

You could also use the -v option to get more detailed information about the request, which will show the SNI extension in the SSL/TLS handshake:

curl -v https://example.com

You can also use the --resolve option to set the SNI hostname explicitly when making the request:

curl --resolve example.com:443:192.0.2.1 https://example.com

This tells cURL to use the IP address 192.0.2.1 for the hostname example.com when making the request, and to use the hostname example.com in the SNI extension.