SSL_INJECT_NET_DGRAM(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’Œ SSL_INJECT_NET_DGRAM πŸ’Œ

okay bestie, so this one lives in the 3ossl manual β€” it's SSL_inject_net_dgram, and honestly? it's giving "backdoor but make it legal" ✨ it lets you hand-feed a datagram to a QUIC connection like it just slid in from the network 🌈


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

int SSL_inject_net_dgram(SSL *s, const unsigned char *buf,
                         size_t buf_len,
                         const BIO_ADDR *peer,
                         const BIO_ADDR *local);

like, that's the whole signature, no notes πŸ’…


✨ DESCRIPTION ✨

so what does it actually do πŸ‘€ this function lets you inject a datagram payload straight into a QUIC connection SSL object. the payload gets processed as though it was received from the network πŸ¦‹ which is lowkey unhinged in the best way. it's for debugging purposes, or for letting datagrams be fed to QUIC from alternative sources β€” iykyk πŸ”₯

buf is required, no cap β€” it has to point to a datagram payload to inject. buf_len is the length of that buffer in bytes. and here's the cute part: the buffer is copied, so it doesn't need to stay valid after this function returns πŸŽ€ no lingering references, we love a clean exit.

peer and local are optional values pointing to BIO_ADDR structures that describe the remote and local UDP endpoint addresses for the packet πŸ‘‘ and like, even though the injected packet was not actually received from the network directly by OpenSSL, the packet will still be processed as though the received datagram had the given addresses. main character energy fr fr πŸ’–


🫢 RETURN VALUES 🫢

returns 1 on success or 0 on failure ✨

⚠️ and heads up bestie: this function always fails if you call it on an SSL object that is not a QUIC connection SSL object. like, always. no exceptions. it's not the vibe for regular TLS, sorry 😭

🌟 SEE ALSO 🌟

go read those too, they're literally part of the lore 🌸


πŸ¦‹ HISTORY πŸ¦‹

SSL_inject_net_dgram() was added in OpenSSL 3.2 β€” so if you're on something older, this icon simply does not exist yet πŸ’€


Copyright 2023 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 whole page, bestie πŸŽ€ this was 3.5.6, dated 2026-04-07, straight from the SSL_INJECT_NET_DGRAM(3ossl) corner of the manual β€” mwah, go inject some datagrams responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from