cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Patch: OpenSSL Server Name Indication value should match custom Host header

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 4 Nov 2010 13:47:43 +0100 (CET)

On Thu, 4 Nov 2010, Hongli Lai wrote:

> I'm using libcurl to send HTTP requests to a specific IP address, but with a
> custom host name.

Yes it should indeed. We've discussed that before on this list, we just
haven't gotten any working code for it yet so thanks a lot for your work!

> libcurl currently sets the TLS Server Name Indication value to the URL's
> host name. This makes it impossible to use Server Name Indication in the
> described use cases. The attached patch solves this problem by setting the
> Server Name Indication value to that of the custom Host header, if any.
>
> Any feedback about this patch would be greatly appreciated.

Peter Sylvester pointed out[1] previously about the hostname in SNI:

      "HostName" contains the fully qualified DNS hostname of the server
      Literal IPv4 and IPv6 addresses are not permitted in "HostName".

The existing Curl_inet_pton() checks in the code makes sure of that, but not
after this patch.

The Curl_inet_pton() checks against conn->host.name in the code needs to be
modified accordingly in your patch to check the 'hostname' variable instead.

Don't you agree?

[1] = http://curl.haxx.se/mail/lib-2010-08/0173.html

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-04