SSL_CTX_SET_...NDING_CONN_CB(3ossl)
π SSL_CTX_SET_...NDING_CONN_CB π
okay bestie, welcome to the 3ossl manual page for SSL_CTX_set_new_pending_conn_cb, SSL_set_new_pending_conn_cb_fn β aka the callback situation that tells your app about brand-new QUIC connection SSL objects the moment they pop into existence. no cap, this is the good stuff β¨
β¨ NAME β¨
SSL_CTX_set_new_pending_conn_cb, SSL_set_new_pending_conn_cb_fn β the callback function that reports the creation of QUIC connection SSL objects π¦
π SYNOPSIS π
typedef int (*SSL_set_new_pending_conn_cb_fn)(SSL_CTX *c, SSL *new_ssl,
void *arg);
void SSL_CTX_set_new_pending_conn_cb(SSL_CTX *c,
SSL_set_new_pending_conn_cb_fn *f,
void *arg);
π DESCRIPTION π
SSL_CTX_set_new_pending_conn_cb() sets the new_pending_conn callback function plus its associated application data argument arg. simple as that, slay π
so here's the lore: when you're using the QUIC transport, TLS handshake processing can happen totally independently from the thread that accepts the connection the handshake is establishing. literally separate threads living their separate lives. which means SSL objects representing the connection may get allocated and initialized before anyone even calls SSL_accept_connection(). iconic, but also a vibe check for your code π
this registered callback is your moment to shine: use it to decorate that preallocated SSL object, or to create other associations with its parent SSL β all prior to a call to SSL_accept_connection(). go off, bestie π«Ά
π₯ RETURN VALUES π₯
SSL_CTX_set_new_pending_conn_cb()β returns, uh, no value. void. nothing. it's giving "no thoughts, head empty" πSSL_set_new_pending_conn_cb_fn()β returns an integer value, and the number matters:- a return value of
0means the QUIC stack must discard this newly createdSSLobject. yep, throw it out β which implies the associated new connection will not be available for handling on a subsequent call toSSL_accept_connection(). bye felicia π - a nonzero return value is treated as success, which allows the new connection to be enqueued to the accept queue. we love a happy ending π
- a return value of
π SEE ALSO π
β οΈ NOTES β οΈ
okay so there are some limitations with callbacks in QUIC connections and you really need to factor them into your app design. not me warning you twice π
- QUIC connections may begin processing prior to when an application calls
SSL_accept_connection()on them. because of this, it can totally happen that callbacks get delivered to your app's registered TLS callbacks before thoseSSLobjects are returned inSSL_accept_connection(). applications should expect this possibility. like, fr fr, plan for it π - in particular, no references should be held on
SSLobjects passed to callbacks for QUIC connections until such time as they are returned through a call toSSL_accept_connection. don't be out here holding onto things that aren't yours yet, bestie π
πΈ HISTORY πΈ
SSL_CTX_set_new_pending_conn_cb() was added in OpenSSL 3.5. fresh-ish, but we're obsessed π
π COPYRIGHT π
Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the tea, bestie π this was version 3.5.6, dated 2026-04-0, straight from the OpenSSL 3ossl manual β now go decorate some preallocated SSL objects and slay ππ§β¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms