]> git.ipfire.org Git - thirdparty/openssl.git/commit
Add SSL_get_peer_addr() function to query peer address for QUIC
authorGustaf Neumann <neumann@wu-wien.ac.at>
Sun, 28 Sep 2025 13:03:32 +0000 (15:03 +0200)
committerTomas Mraz <tomas@openssl.org>
Sat, 4 Oct 2025 08:21:38 +0000 (10:21 +0200)
commitbeec4e146a9ec755c83d6521a428ea103bdc8607
tree4d07a8155b8f3101fda62d4e6e6c9bbe1e656349
parent2b97f4d300f18b209983046f49e12f3028ba79f5
Add SSL_get_peer_addr() function to query peer address for QUIC

This change introduces a new public API symbol: SSL_get_peer_addr().
The change is QUIC-only, there are no changes for TLS connections

- API: add peer address query for QUIC connections
  * Internal: declare/implement ossl_quic_get_peer_addr(SSL*, BIO_ADDR*)
  * Public: declare/implement SSL_get_peer_addr(SSL*, BIO_ADDR*)

Rationale:
- Allow applications to retrieve the remote UDP tuple for QUIC sessions
  (e.g., logging, access control, diagnostics)

Provided documentation and test cases for SSL_get_peer_addr().

Set peer via channel API on new-conn.

- In ch_on_new_conn_common(), BIO_ADDR_copy(&ch->cur_peer_addr, peer)
  was replaced with ossl_quic_channel_set_peer_addr(ch, peer) so
  addressed_mode is enabled at connection bring-up.

Dropped redundant peer detection in create_qc_from_incoming_conn()

The peer address is now propagated in ch_on_new_conn_common() via
ossl_quic_channel_set_peer_addr(), so the channel is already in
"addressed" mode. This also avoids querying the (unconnected) server
UDP BIO, reduces duplication, and simplifies the accept path. All
regression tests pass.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28690)
doc/build.info
doc/man3/SSL_get_peer_addr.pod [new file with mode: 0644]
doc/man7/openssl-quic.pod
include/internal/quic_ssl.h
include/openssl/ssl.h.in
ssl/quic/quic_channel.c
ssl/quic/quic_impl.c
ssl/quic/quic_port.c
ssl/ssl_lib.c
test/quicapitest.c
util/libssl.num