SSL_GET_PEER_ADDR(3SSL)

πŸ“¦
version 4.0.3 Β· 2 versions
, in ubuntu stonking

πŸ’– SSL_GET_PEER_ADDR(3SSL) πŸ’–

okay bestie, so this is a page from the OpenSSL manual, section 3SSL, and it's all about finding out who's on the other end of your QUIC connection. yes, like actually who β€” their address. the whole vibe. let's get into it 🫢


✨ NAME ✨

SSL_get_peer_addr β€” bestie, this is the one that gets you the peer address of a QUIC connection. that's it, that's the job. πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

int SSL_get_peer_addr(SSL *ssl, BIO_ADDR *peer_addr);

like. two args. so simple. so iconic. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so SSL_get_peer_addr() goes and grabs the peer address of a QUIC connection, and then it stores it into the BIO_ADDR structure that peer_addr is pointing at. so you, the caller, have to hand over a valid BIO_ADDR object β€” that's on you β€” and it gets filled in once everything works out. πŸ’–

and like, important: this function is only meaningful when you call it on an SSL object that represents a QUIC connection or a QUIC stream. if your SSL object isn't QUIC, this is not the move. it's just not valid there. πŸ™ˆ


πŸ‘‘ NOTES πŸ‘‘

so, the peer address is literally the remote endpoint of a QUIC connection. that's what it identifies. periodt.

here's the tea though: for the UDP sockets QUIC uses, the kernel does not maintain a connected peer the way it does for TCP. nope. so instead, the peer address gets tracked in the QUIC connection state itself. and SSL_get_peer_addr() is your way to pull that address info back out of OpenSSL. πŸ’…

also, BIO_ADDR is an OpenSSL abstraction that can hold both IPv4 and IPv6 socket addresses β€” versatile queen behavior. if you want the address family, you grab it through the BIO_ADDR(3) API. 🌈


⭐ RETURN VALUES ⭐

  • 1 β€” success! slay. πŸŽ€
  • 0 β€” this is the oopsie. it returns 0 on failure, or if you called it on an SSL object that isn't a QUIC SSL object. and in that case, peer_addr is left unchanged. no half-finished edits, no chaos. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

go read those bestie, they're all in the same friend group. 🫢


πŸ’œ HISTORY πŸ’œ

this function was added in OpenSSL 4.0. so yeah, it's new-new. you're early. 🌟


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


no cap: legal text stays legal text, bestie. don't skip it. πŸ’–

and that's the whole page!! this was OpenSSL 4.0.3, dated 2026-09-29, filed under SSL_GET_PEER_ADDR(3SSL). mwah. go get that peer address. πŸ‘‘βœ¨

πŸ“¦ where this page comes from