doc(netxlite/tls.go): explain what the handshake returns (#490)

Part of https://github.com/ooni/probe/issues/1591
This commit is contained in:
Simone Basso 2021-09-08 17:21:51 +02:00 committed by GitHub
parent 26360f5a29
commit 957185d659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,6 +118,10 @@ type TLSHandshaker interface {
// Handshake creates a new TLS connection from the given connection and // Handshake creates a new TLS connection from the given connection and
// the given config. This function DOES NOT take ownership of the connection // the given config. This function DOES NOT take ownership of the connection
// and it's your responsibility to close it on failure. // 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) ( Handshake(ctx context.Context, conn net.Conn, config *tls.Config) (
net.Conn, tls.ConnectionState, error) net.Conn, tls.ConnectionState, error)
} }