SSL_get_peer_addr.3ossl - Man Page

obtain the peer address of a QUIC connection

Synopsis

 #include <openssl/ssl.h>

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

Description

SSL_get_peer_addr() retrieves the peer address of a QUIC connection and stores it into the BIO_ADDR structure pointed to by peer_addr. The caller must supply a valid BIO_ADDR object which will be filled in on success.

This function is only meaningful when called on an SSL object which represents a QUIC connection or stream. It is not valid for non-QUIC SSL objects.

Notes

The peer address identifies the remote endpoint of a QUIC connection. For UDP sockets used by QUIC, the kernel does not maintain a connected peer in the same sense as for TCP. Instead, the peer address is tracked in the QUIC connection state. SSL_get_peer_addr() provides a way to obtain this address information from OpenSSL.

The BIO_ADDR type is an OpenSSL abstraction which can represent both IPv4 and IPv6 socket addresses. Applications can get the address family via the BIO_ADDR(3) API.

Return Values

SSL_get_peer_addr() returns 1 on success. On failure, or if called on an SSL object which is not a QUIC SSL object, 0 is returned and peer_addr is left unchanged.

See Also

SSL_accept_connection(3), SSL_accept_stream(3), BIO_ADDR(3)

History

This function was added in OpenSSL 4.0.

Referenced By

openssl-quic.7ossl(7).

2026-06-09 4.0.1 OpenSSL