]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: ssl: subsequent handshakes fail after server configuration changes
authorEmeric Brun <ebrun@exceliance.fr>
Thu, 4 Oct 2012 15:09:56 +0000 (17:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 5 Oct 2012 19:46:52 +0000 (21:46 +0200)
On server's configuration change, if the previously used
cipher is disabled, all subsequent connect attempts fail.

Fix consists in freeing cached session on handshake failure.

src/ssl_sock.c

index 88a5adb7d9c5554ad41602ab5084227fca1ed3ea..9f611986556111eca6724b046bab4c167f559316 100644 (file)
@@ -747,6 +747,12 @@ int ssl_sock_handshake(struct connection *conn, unsigned int flag)
        return 1;
 
  out_error:
+       /* free resumed session if exists */
+       if (target_srv(&conn->target) && target_srv(&conn->target)->ssl_ctx.reused_sess) {
+               SSL_SESSION_free(target_srv(&conn->target)->ssl_ctx.reused_sess);
+               target_srv(&conn->target)->ssl_ctx.reused_sess = NULL;
+       }
+
        /* Fail on all other handshake errors */
        conn->flags |= CO_FL_ERROR;
        conn->flags &= ~flag;