diff --git a/src/quic_ssl.c b/src/quic_ssl.c index 45915773b..32d5982e5 100644 --- a/src/quic_ssl.c +++ b/src/quic_ssl.c @@ -1018,6 +1018,14 @@ int qc_ssl_do_hanshake(struct quic_conn *qc, struct ssl_sock_ctx *ctx) /* Wake up MUX after its creation. Operation similar to TLS+ALPN on TCP stack. */ qc->conn->mux->wake(qc->conn); } + else { + /* Wake up upper layer if the MUX is alreay initialized. + * This is the case when the MUX was started for a 0-RTT session + * but without early-data secrets to send them (when the server + * does not support 0-RTT). + */ + qc_notify_send(qc); + } } else { TRACE_PROTO("could not start the mux", QUIC_EV_CONN_IO_CB, qc); diff --git a/src/quic_tx.c b/src/quic_tx.c index e78df8a05..fa3c99bfe 100644 --- a/src/quic_tx.c +++ b/src/quic_tx.c @@ -521,6 +521,16 @@ enum quic_tx_err qc_send_mux(struct quic_conn *qc, struct list *frms, TRACE_ENTER(QUIC_EV_CONN_TXPKT, qc); + if (!qel) { + BUG_ON(!qc_is_back(qc) || + !(__objt_server(qc->conn->target)->ssl_ctx.options & SRV_SSL_O_EARLY_DATA)); + /* This may happen when 0-RTT is enabled without early-data level secrets. + * This always occurs when the server peer does not support 0-RTT. + */ + TRACE_DEVEL("cannot send at 0-RTT level", QUIC_EV_CONN_TXPKT, qc); + return QUIC_TX_ERR_NONE; + } + if (qc->conn->flags & CO_FL_SOCK_WR_SH) { qc->conn->flags |= CO_FL_ERROR | CO_FL_SOCK_RD_SH; TRACE_DEVEL("connection on error", QUIC_EV_CONN_TXPKT, qc); diff --git a/src/xprt_quic.c b/src/xprt_quic.c index ca7d4e9f9..b177c6656 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -209,8 +209,11 @@ static int qc_xprt_start(struct connection *conn, void *ctx) /* Schedule quic-conn to ensure post handshake frames are emitted. This * is not done for 0-RTT as xprt->start happens before handshake * completion. + * Note that, when 0-RTT is enabled for backend connections, it is + * possible that the ealy-data secrets could not be derived. This is the + * case when the server does not support 0-RTT. */ - if ((qc_is_back(qc) && !qc_is_conn_ready(qc)) || + if ((qc_is_back(qc) && (!qc_is_conn_ready(qc) || !qc->eel)) || (qc->flags & QUIC_FL_CONN_NEED_POST_HANDSHAKE_FRMS)) tasklet_wakeup(qc->wait_event.tasklet);