---
name: "SSL_CTX_set_new_pending_conn_cb"
section: "3ssl"
platform: "linux"
package: "openssl"
version: "3.6.5-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/SSL_CTX_set_new_pending_conn_cb"
---

# SSL\_CTX\_set\_new\_pending\_conn\_cb(3ssl)

callback function to report creation of QUIC connection SSL objects

## NAME

SSL\_CTX\_set\_new\_pending\_conn\_cb, SSL\_set\_new\_pending\_conn\_cb\_fn - callback function to report 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 and associated application data argument *arg*.  When using the QUIC transport, TLS handshake processing may occur independently from the thread which accepts the connection that the handshake is establishing.  As such, **SSL** objects representing the connection may be allocated and initialized prior to a call to **SSL\_accept\_connection()**.  This registered callback may be used to decorate the  preallocated **SSL** object or create other associations with its parent **SSL** prior to a call to **SSL\_accept\_connection()**.

## RETURN VALUES

**SSL\_CTX\_set\_new\_pending\_conn\_cb()** returns no value.

**SSL\_set\_new\_pending\_conn\_cb\_fn()** returns an integer value.  A return value of 0 indicates that the QUIC stack must discard this newly created **SSL** object, implying that the associated new connection will not be available for handling on a subsequent call to **SSL\_accept\_connection()**.  A nonzero return value is treated as success, allowing the new connection to be enqueued to the accept queue.

## SEE ALSO

**SSL\_set\_ex\_data**(3)

## NOTES

Callbacks in QUIC connections have some limitations to them that should be taken into consideration when writing an application.

QUIC connections may begin processing prior to when an application calls **SSL\_accept\_connection()** on them.  As such, it may occur that callbacks are delivered to applications' registered TLS callbacks prior to those SSL objects being returned in **SSL\_accept\_connection()**.  Applications should expect this possibility.

In particular no references should be held on SSL objects passed to callbacks for QUIC connections until such time as they are returned through a call to SSL\_accept\_connection.

## HISTORY

**SSL\_CTX\_set\_new\_pending\_conn\_cb()** was added in OpenSSL 3.5

## 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\>.
