Skip to content
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: TLS client handshake never times out #2281

Closed
bradfitz opened this issue Sep 20, 2011 · 5 comments
Closed

crypto/tls: TLS client handshake never times out #2281

bradfitz opened this issue Sep 20, 2011 · 5 comments

Comments

@bradfitz
Copy link
Contributor

Forking off part of https://golang.org/issue/2263 ,

The TLS server handshake never times out if the underlying socket has a read timeout on
it.

readHandshake() in crypto/tls/conn.go loops forever, continually getting EAGAIN in
readRecord from readFromUntil.

I'm not sure the best place to fix.  I could do my own timeout up in http land, but I
think TLS should probably (also?) deal with this somehow.

Thoughts?
@bradfitz
Copy link
Contributor Author

Comment 1:

Failing test in http://golang.org/cl/5092045/

@bradfitz
Copy link
Contributor Author

Comment 2:

rsc writes:
> If tls is ignoring _any_ read error,
> including EAGAIN, that's a bug and
> should be fixed.
What's happening is that err,(net.Error).Temporary() == true, so it retries.

@rsc
Copy link
Contributor

rsc commented Sep 21, 2011

Comment 3:

I don't remember why that's there.  It doesn't seem right.

@bradfitz
Copy link
Contributor Author

Comment 4:

Submitted the failing (but disabled) test in
http://code.google.com/p/go/source/detail?r=6cf7829b4c9287fb7a5713622a1af4546d567c63
The fix for this bug should enable that test.

@agl
Copy link
Contributor

agl commented Oct 18, 2011

Comment 5:

This issue was closed by revision 9d99d52.

Status changed to Fixed.

@mikioh mikioh changed the title TLS client handshake never times out crypto/tls: TLS client handshake never times out Jan 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
FiloSottile pushed a commit to FiloSottile/go that referenced this issue Oct 12, 2018
tls.Conn.Close() didn't close the underlying connection and tried to
do a handshake in order to send the close notify alert.

http didn't look for errors from the TLS handshake.

Fixes golang#2281.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5283045
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants