SSL_SET1_INITIAL_PEER_ADDR(3ossl)

πŸ’… SSL_SET1_INITIAL_PEER_ADDR πŸ’…

okay bestie, welcome to the OpenSSL manual, page SSL_set1_initial_peer_addr from the 3ossl section. yes we are reading manpages for fun now, this is the vibe, iykyk πŸ¦‹


✨ NAME ✨

SSL_set1_initial_peer_addr β€” set the initial peer address for a QUIC connection πŸ’–


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

int SSL_set1_initial_peer_addr(SSL *s, const BIO_ADDR *addr);

πŸŽ€ DESCRIPTION πŸŽ€

so like, SSL_set1_initial_peer_addr() sets the initial destination peer address that's gonna be used for the purposes of establishing a QUIC connection in client mode. that's it, that's the whole job, she's an icon with one task πŸ’…

now, the rules (there are always rules):

  • this function can be used only on a QUIC connection SSL object 🫢
  • and it can be used only before a connection attempt is first made. like, once you've already slid into the DMs, you can't change your opening line, okay?

addr must point to a BIO_ADDR representing a UDP destination address of the server to connect to. literally that's the address, of the server, that you connect to. no cap ⭐


okay now the fun part, the automatic detection situation. where a QUIC connection object is provided with a write BIO which supports the BIO_CTRL_DGRAM_GET_PEER control (for example, BIO_s_dgram), the initial destination peer address can be detected automatically. if BIO_CTRL_DGRAM_GET_PEER returns a valid (non-AF_UNSPEC) peer address and no valid peer address has yet been set, this will be set automatically as the initial peer address. the universe just... handles it for you. iconic ✨

and if you want to override that auto-magic? you can! this behaviour can be overridden by calling SSL_set1_initial_peer_addr() with a valid peer address explicitly. main character energy, you decide the address πŸ™ˆ

⚠️ heads up bestie: the destination address used by QUIC may change over time in response to connection events, such as connection migration (where supported). SSL_set1_initial_peer_addr() configures the destination address used for initial connection establishment, and does not confer any guarantee about the destination address being used for communication at any later time in the connection lifecycle. so she sets the vibe for the first hello, not forever. periodt πŸ’€

also, and this part is so nice of her: this function makes a copy of the address passed by the caller. so the BIO_ADDR structure pointed to by addr may be freed by the caller after this function returns. go ahead and free it, she's got her own copy now, she's not clingy 🧚


πŸ’œ RETURN VALUES πŸ’œ

  • returns 1 on success 🌈
  • returns 0 on failure 😭

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ“ HISTORY πŸ“

the SSL_set1_initial_peer_addr() function was added in OpenSSL 3.2. babygirl is relatively new to the group chat but she's already thriving 🌸


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


okay that's the whole page bestie, you ate that reading experience, so proud of you πŸ«ΆπŸ’–

and for the cute sign-off: this was OpenSSL 3.5.9, dated 2026-09-29, and the page title is SSL_SET1_INITIAL_PEER_ADDR(3ossl). mwah, go set some initial peer addresses responsibly, love you, bye πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from