]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: ssl: for a handshake when server-side SNI changes
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2016 20:58:38 +0000 (21:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Dec 2016 15:21:40 +0000 (16:21 +0100)
commit119a4084bf88418bce74d8af686576e371700c20
tree913df5c4de74537f61e5801835bc220c83939299
parent57b877147d726a743a038e7101b6d2e6922116c7
BUG/MEDIUM: ssl: for a handshake when server-side SNI changes

Calling SSL_set_tlsext_host_name() on the current SSL ctx has no effect
if the session is being resumed because the hostname is already stored
in the session and is not advertised again in subsequent connections.
It's visible when enabling SNI and health checks at the same time because
checks do not send an SNI and regular traffic reuses the same connection,
resulting in no SNI being sent.

The only short-term solution is to reset the reused session when the
SNI changes compared to the previous one. It can make the server-side
performance suffer when SNIs are interleaved but it will work. A better
long-term solution would be to keep a small cache of a few contexts for
a few SNIs.

Now with SSL_set_session(ctx, NULL) it works. This needs to be double-
checked though. The man says that SSL_set_session() frees any previously
existing context. Some people report a bit of breakage when calling
SSL_set_session(NULL) on openssl 1.1.0a (freed session not reusable at
all though it's not an issue for now).

This needs to be backported to 1.7 and 1.6.
src/ssl_sock.c