New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto/tls: Currently there's no way to find out what protocol was used to negotiate TLS connection on the client #7231
Labels
Milestone
Comments
Owner changed to @agl. |
Not sure what's your use case but for debugging/developing/dissecting TLS stuff at plugfest, you can scratch an established tls.Conn by using package reflect like the following: func tlsVersion(c *tls.Conn) (int, error) { cv := reflect.ValueOf(c) switch ce := cv.Elem(); ce.Kind() { case reflect.Struct: fe := ce.FieldByName("vers") return int(fe.Uint()), nil } return 0, errors.New("something wrong") } For managing TLS entities, you can also implement http://tools.ietf.org/html/rfc6353. |
Comment 3 by manoj.dayaram@moovweb.com: Eh, this is something I'd like to do on every request, so ideally, I'd like something very performant. I'm not sure what the performance hit of using the reflection package is, but it seems to me that it would be much slower than a straight up dereference check =/ |
Comment 5 by manoj.dayaram@moovweb.com: I've given a crack at adding the patch myself, seemed straight forward enough that I figured I would give it a try: https://golang.org/cl/55400044/#ps2 |
This issue was closed by revision c7612f3. Status changed to Fixed. |
FiloSottile
pushed a commit
to FiloSottile/go
that referenced
this issue
Oct 12, 2018
Fixes golang#7231. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/68250043
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by manoj.dayaram@moovweb.com:
The text was updated successfully, but these errors were encountered: