Skip to content

crypto/tls: Currently there's no way to find out what protocol was used to negotiate TLS connection on the client #7231

Description

@gopherbot

by manoj.dayaram@moovweb.com:

As far as I can tell, there's no exposure to what TLS protocol was used after performing
the TLS handshake.  I noticed we store the version that was used here:

http://golang.org/src/pkg/crypto/tls/handshake_client.go#L85

However, this is in a private member of the Connection structure, and there are no
accessors for it.

Now that Go supports more than just TLS1.0 for secure connections from the client side,
it would be nice to expose what protocol was used to perform the handshake.  I figured
adding a Version() method to the connection or perhaps a member in the ConnectionState
struct would work quite nicely.

I scraped/read as much of the crypto/tls package but I'm not super familiar with crypto
stuff.  I couldn't really see a way to be able to determine this information as a user
of the library, so sorry if I'm missing an obvious way to access this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions