From 957185d65996cd4b56fb8e8655b292e5942eb296 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Wed, 8 Sep 2021 17:21:51 +0200 Subject: [PATCH] doc(netxlite/tls.go): explain what the handshake returns (#490) Part of https://github.com/ooni/probe/issues/1591 --- internal/netxlite/tls.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/netxlite/tls.go b/internal/netxlite/tls.go index 296fb8b..e2af24e 100644 --- a/internal/netxlite/tls.go +++ b/internal/netxlite/tls.go @@ -118,6 +118,10 @@ type TLSHandshaker interface { // Handshake creates a new TLS connection from the given connection and // the given config. This function DOES NOT take ownership of the connection // and it's your responsibility to close it on failure. + // + // The returned connection will always implement the TLSConn interface + // exposed by this package. A future version of this interface will instead + // return directly a TLSConn and remove the ConnectionState param. Handshake(ctx context.Context, conn net.Conn, config *tls.Config) ( net.Conn, tls.ConnectionState, error) }