git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFH/PATCH] imap-send: support SNI (RFC4366)

From
Jeff King <peff@peff.net>
Date
Feb 21, 2013, 05:48 UTC
Message-ID
<20130221054803.GB25943@sigill.intra.peff.net>
In-Reply-To
<7vr4kaw7or.fsf@alter.siamese.dyndns.org>
On Wed, Feb 20, 2013 at 09:35:16PM -0800, Junio C Hamano wrote:
Show 15 quoted lines
>>  (2) I do not know if everybody has SSL_set_tslext_host_name() macro
>>      defined, so this patch may be breaking build for people with
>>      different versions of OpenSSL.
> [...]
>
> +#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
> +	/*
> +	 * SNI (RFC4366)
> +	 * OpenSSL does not document this function, but the implementation
> +	 * returns 1 on success, 0 on failure after calling SSLerr().
> +	 */
> +	ret = SSL_set_tlsext_host_name(sock->ssl, server.host);
> +	if (ret != 1)
> +		warning("SSL_set_tslext_host_name(%s) failed.\n", server.host);
> +#endif

Yes, I think this is the right macro to check. According to OpenSSL's CHANGES file, it was introduced between 0.9.8n and 1.0.0 (Mar 2010). But I note that the use of the same macro in libcurl dates to 2008. Curious.

Note that you have a typo in your warning text (tslext) and an extra newline.

As far as testing goes, I don't have an SNI IMAP server handy, but I think you can simulate one with "openssl s_server". It may be a good long-term goal to test any ssl-specific code against that in our test suite (on the other hand, most of the interesting stuff is https, where the details are all handled by curl).

-Peff
Previous: Junio C Hamano
Message 3 of 3 in “imap-send: support SNI (RFC4366)”
  1. imap-send: support SNI (RFC4366)Junio C Hamano, Feb 21, 2013
  2. Junio C HamanoFeb 21, 2013
  3. Jeff KingFeb 21, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.