SSL_GET0_CONNECTION(3SSL)

πŸ’– SSL_get0_connection β€” your QUIC connection bestie finder πŸ’–

okay so this is the SSL_GET0_CONNECTION(3SSL) page from the OpenSSL fam, and it's honestly so short and so helpful. no cap.

✨ NAME ✨

SSL_get0_connection, SSL_is_connection β€” get a QUIC connection SSL object from a QUIC stream SSL object πŸ¦‹

like... if you have a stream and you're like "wait who's your mom", this is the function. it's giving family reunion. πŸ‘‘


✨ SYNOPSIS ✨

#include <openssl/ssl.h>

SSL *SSL_get0_connection(SSL *ssl);
int SSL_is_connection(SSL *ssl);

yes bestie, literal two functions. two lines. iconic. πŸ’…


✨ DESCRIPTION ✨

okay so let's break this down because there are like three whole scenarios and each one has main character energy.

  • SSL_get0_connection() β€” when you call it on a QUIC stream SSL object, it hands you back the QUIC connection SSL object that this stream belongs to. found your parent fr fr 🫢

when you call it on a QUIC connection SSL object? it just gives you back that exact same object. self-love, periodt. ✨

and when you call it on a non-QUIC object? it returns the same object you passed in. yeah, it just boomerangs it right back at you. no thoughts, just vibes. πŸ“

  • SSL_is_connection() β€” returns 1 for QUIC connection SSL objects, and 1 for non-QUIC SSL objects, but returns 0 for QUIC stream SSL objects. so it's like a little vibe check: "are you a connection or not?" πŸ’€

✨ RETURN VALUES ✨

  • SSL_get0_connection() β€” returns the QUIC connection SSL object (if you gave it a QUIC stream SSL object), and otherwise returns the same SSL object you passed in. and the important bit: it always returns non-NULL. no NULL jumpscares here, we're safe. 🌈
  • SSL_is_connection() β€” returns 1 if the SSL object is not a QUIC stream SSL object, and 0 otherwise. that's it, that's the whole tea. β˜•

✨ SEE ALSO ✨

go read these too, they're all part of the same friend group: SSL_new(3), SSL_new_stream(3), SSL_accept_stream(3) 🌸


✨ HISTORY ✨

these functions said "hey" to the world in OpenSSL 3.2. babies, but competent babies. πŸ‘ΆπŸ’–


Copyright 2002-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>.

ngl, the license is not a suggestion, bestie. read it, comply with it, live it. πŸ’…

and that's the whole page!! this was version 4.0.3, dated 2026-09-29, brought to you by the OpenSSL girlies. kthxbye, go get you a connection object πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from