mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-11 01:54:08 +02:00
In order to send early data, we have to make sure no handshake has been initiated at all. To do that, we remove the CO_FL_SSL_WAIT_HS flag, so that we won't attempt to start a handshake. However, by removing those flags, we allow ssl_sock_to_buf() to call SSL_read(), as it's no longer aware that no handshake has been done, and SSL_read() will begin the handshake, thus preventing us from sending early data. The fix is to just call SSL_in_before() to check if no handshake has been done yet, in addition to checking CO_FL_SSL_WAIT_HS (both are needed, as CO_FL_SSL_WAIT_HS may come back in case of renegociation). In ssl_sock_from_buf(), fix the check to see if we may attempt to send early data. Use SSL_in_before() instead of SSL_is_init_finished(), as SSL_is_init_finished() will return 1 if the handshake has been started, but not terminated, and if the handshake has been started, we can no longer send early data. This fixes errors when attempting to send early data (as well as actually sending early data). This should be backported up to 2.8.