From 0d7dc54a591c12b4bd03bcd745024178d03d9218 Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Wed, 5 Feb 2025 16:56:42 -0800 Subject: [PATCH] quic: add Conn.ConnectionState Add a method that returns the tls.ConnectionState for a connection. Generally useful, and also required to let HTTP/3 expose the ConnectionState in Requests. Change-Id: Iba725e0f40c68020fc6ee45d49f5c609a2b6b493 Reviewed-on: https://go-review.googlesource.com/c/net/+/647075 Auto-Submit: Damien Neil Reviewed-by: Jonathan Amsterdam LUCI-TryBot-Result: Go LUCI --- quic/conn.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/quic/conn.go b/quic/conn.go index bf54409bfe..1f1cfa6d0a 100644 --- a/quic/conn.go +++ b/quic/conn.go @@ -186,6 +186,11 @@ func (c *Conn) RemoteAddr() netip.AddrPort { return c.peerAddr } +// ConnectionState returns basic TLS details about the connection. +func (c *Conn) ConnectionState() tls.ConnectionState { + return c.tls.ConnectionState() +} + // confirmHandshake is called when the handshake is confirmed. // https://www.rfc-editor.org/rfc/rfc9001#section-4.1.2 func (c *Conn) confirmHandshake(now time.Time) {