SSL_SET1_INITIAL_PEER_ADDR(3ossl)
π SSL_set1_initial_peer_addr(3ossl) β¨
okay bestie, so this is a page from the OpenSSL manual β it's called SSL_SET1_INITIAL_PEER_ADDR and honestly it's giving "small function, big QUIC energy." Let's get into it π«Ά
πΈ NAME πΈ
SSL_set1_initial_peer_addr β sets 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 SSL_set1_initial_peer_addr() sets the initial destination peer address β the one used for the purposes of establishing a QUIC connection in client mode. That's the whole vibe β¨
Real talk though, there's rules, and you gotta respect them:
- This function can be used only on a QUIC connection
SSLobject. - It can be used only before a connection attempt is first made. Like, first-move-only, no takebacks, periodt π
addr must point to a BIO_ADDR representing a UDP destination address of the server to connect to π―
π« the auto-detect situation π«
Okay so, this is lowkey the cool part. 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 π
Specifically: 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. Iconic, no cap π
But β and this is the "not me overriding the vibes" moment β this behaviour can be overridden by calling SSL_set1_initial_peer_addr() with a valid peer address explicitly. So if you wanna be the main character, you absolutely can π
π§ the address may change, okay? π§
The destination address used by QUIC may change over time in response to connection events, such as connection migration (where supported). So don't get attached π
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. It's giving "starter address," not "forever address" π
π memory behaviour π
This function makes a copy of the address passed by the caller; the BIO_ADDR structure pointed to by addr may be freed by the caller after this function returns. So you don't have to keep it alive β she's independent now π
β¨
π RETURN VALUES π
Returns 1 on success and 0 on failure. That's it, that's the whole mood π«Ά
π₯ SEE ALSO π₯
β HISTORY β
The SSL_set1_initial_peer_addr() function was added in OpenSSL 3.2. So if you're on something older, bestie, she is simply not there π
π COPYRIGHT π
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, you ate that π β this cutie landed in OpenSSL 3.5.0, dated 2026-09-25, and that's the sign-off, mwah π§ββοΈβ¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms