1*e7be843bSPierre Pronchery=pod 2*e7be843bSPierre Pronchery 3*e7be843bSPierre Pronchery=head1 NAME 4*e7be843bSPierre Pronchery 5*e7be843bSPierre ProncherySSL_set1_initial_peer_addr - set the initial peer address for a QUIC connection 6*e7be843bSPierre Pronchery 7*e7be843bSPierre Pronchery=head1 SYNOPSIS 8*e7be843bSPierre Pronchery 9*e7be843bSPierre Pronchery #include <openssl/ssl.h> 10*e7be843bSPierre Pronchery 11*e7be843bSPierre Pronchery int SSL_set1_initial_peer_addr(SSL *s, const BIO_ADDR *addr); 12*e7be843bSPierre Pronchery 13*e7be843bSPierre Pronchery=head1 DESCRIPTION 14*e7be843bSPierre Pronchery 15*e7be843bSPierre ProncherySSL_set1_initial_peer_addr() sets the initial destination peer address to be used 16*e7be843bSPierre Proncheryfor the purposes of establishing a QUIC connection in client mode. This function 17*e7be843bSPierre Proncherycan be used only on a QUIC connection SSL object, and can be used only before a 18*e7be843bSPierre Proncheryconnection attempt is first made. I<addr> must point to a B<BIO_ADDR> 19*e7be843bSPierre Proncheryrepresenting a UDP destination address of the server to connect to. 20*e7be843bSPierre Pronchery 21*e7be843bSPierre ProncheryWhere a QUIC connection object is provided with a write BIO which supports the 22*e7be843bSPierre ProncheryB<BIO_CTRL_DGRAM_GET_PEER> control (for example, B<BIO_s_dgram>), the initial 23*e7be843bSPierre Proncherydestination peer address can be detected automatically; if 24*e7be843bSPierre ProncheryB<BIO_CTRL_DGRAM_GET_PEER> returns a valid (non-B<AF_UNSPEC>) peer address and 25*e7be843bSPierre Proncheryno valid peer address has yet been set, this will be set automatically as the 26*e7be843bSPierre Proncheryinitial peer address. This behaviour can be overridden by calling 27*e7be843bSPierre ProncherySSL_set1_initial_peer_addr() with a valid peer address explicitly. 28*e7be843bSPierre Pronchery 29*e7be843bSPierre ProncheryThe destination address used by QUIC may change over time in response to 30*e7be843bSPierre Proncheryconnection events, such as connection migration (where supported). 31*e7be843bSPierre ProncherySSL_set1_initial_peer_addr() configures the destination address used for initial 32*e7be843bSPierre Proncheryconnection establishment, and does not confer any guarantee about the 33*e7be843bSPierre Proncherydestination address being used for communication at any later time in the 34*e7be843bSPierre Proncheryconnection lifecycle. 35*e7be843bSPierre Pronchery 36*e7be843bSPierre ProncheryThis function makes a copy of the address passed by the caller; the B<BIO_ADDR> 37*e7be843bSPierre Proncherystructure pointed to by I<addr> may be freed by the caller after this function 38*e7be843bSPierre Proncheryreturns. 39*e7be843bSPierre Pronchery 40*e7be843bSPierre Pronchery=head1 RETURN VALUES 41*e7be843bSPierre Pronchery 42*e7be843bSPierre ProncheryReturns 1 on success and 0 on failure. 43*e7be843bSPierre Pronchery 44*e7be843bSPierre Pronchery=head1 SEE ALSO 45*e7be843bSPierre Pronchery 46*e7be843bSPierre ProncheryL<BIO_ADDR(3)>, L<ssl(7)> 47*e7be843bSPierre Pronchery 48*e7be843bSPierre Pronchery=head1 HISTORY 49*e7be843bSPierre Pronchery 50*e7be843bSPierre ProncheryThe SSL_set1_initial_peer_addr() function was added in OpenSSL 3.2. 51*e7be843bSPierre Pronchery 52*e7be843bSPierre Pronchery=head1 COPYRIGHT 53*e7be843bSPierre Pronchery 54*e7be843bSPierre ProncheryCopyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved. 55*e7be843bSPierre Pronchery 56*e7be843bSPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 57*e7be843bSPierre Proncherythis file except in compliance with the License. You can obtain a copy 58*e7be843bSPierre Proncheryin the file LICENSE in the source distribution or at 59*e7be843bSPierre ProncheryL<https://www.openssl.org/source/license.html>. 60*e7be843bSPierre Pronchery 61*e7be843bSPierre Pronchery=cut 62