MINOR: quic: Fix SSL error issues (do not use ssl_bio_and_sess_init())
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 28 Sep 2021 07:51:23 +0000 (09:51 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 7 Oct 2021 15:35:25 +0000 (17:35 +0200)
commit75dd2b7987f0c9bede8a73e61e89bf784a2ea593
treed975cb58dbccbbc201a837067d55671e710162dc
parent7c881bdab8337acfc960de208383843928c1afad
MINOR: quic: Fix SSL error issues (do not use ssl_bio_and_sess_init())

It seems it was a bad idea to use the same function as for TCP ssl sockets
to initialize the SSL session objects for QUIC with ssl_bio_and_sess_init().
Indeed, this had as very bad side effects to generate SSL errors due
to the fact that such BIOs initialized for QUIC could not finally be controlled
via the BIO_ctrl*() API, especially BIO_ctrl() function used by very much other
internal OpenSSL functions (BIO_push(), BIO_pop() etc).
Others OpenSSL base QUIC implementation do not use at all BIOs to configure
QUIC connections. So, we decided to proceed the same way as ngtcp2 for instance:
only initialize an SSL object and call SSL_set_quic_method() to set its
underlying method. Note that calling this function silently disable this option:
SSL_OP_ENABLE_MIDDLEBOX_COMPAT.
We implement qc_ssl_sess_init() to initialize SSL sessions for QUIC connections
to do so with a retry in case of allocation failure as this is done by
ssl_bio_and_sess_init(). We also modify the code part for haproxy servers.
src/xprt_quic.c