cURL / Mailing Lists / curl-users / Single Mail


Re: Specify SNI server name for HTTPS client hello

From: Daniel Stenberg <>
Date: Fri, 23 Jan 2015 22:48:42 +0100 (CET)

On Fri, 23 Jan 2015, Norton, Mike wrote:

> Is there a way to specify what gets used for the server name in the TLS
> client hello? I need to specify the server name to test a reverse proxy
> server that is not yet in DNS. The server requires SNI or else it will close
> the connection. I'm trying to do something like this:
> $ curl -k -I -H "Host:" ""

> I want to send "" as the HTTP host and as the TLS server
> name, but I want to connect to, which is not necessarily the same
> IP that's in DNS for that name. Is there a way to do that using command-line
> options?

You want --resolve!

        --resolve <host:port:address>
               Provide a custom address for a specific host and port pair.
               Using this, you can make the curl requests(s) use a specified
               address and prevent the otherwise normally resolved address to
               be used. Consider it a sort of /etc/hosts alternative provided
               on the command line. The port number should be the number used
               for the specific protocol the host will be used for. It means
               you need several entries if you want to provide address for the
               same host but different ports.


   curl -k -I --resolve

List admin:
Received on 2015-01-23