-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Description
If the server closes the connection before handshake completes, net/tls returns a non-descriptive error "EOF".
https://play.golang.org/p/zI-MazOG7v
Also locally go version go1.8 darwin/amd64
This may be same as #13523 (comment) @rsc @bradfitz .
What did you expect to see?
A more descriptive error similar to other errors from net/tls.
- dial tcp 127.0.0.1:8081: getsockopt: connection refused
- x509: cannot validate certificate for 216.58.209.132 because it doesn't contain any IP SANs
What did you see instead?
_, err := tls.Dial("tcp", "127.0.0.1:8080", nil)
if err != nil {
fmt.Println(err)
fmt.Printf("%#v == io.EOF: %v", err, err == io.EOF)
}
Output:
EOF
&errors.errorString{s:"EOF"} == io.EOF: true
Of course there is nothing that can be done, the closing of underlying connection is fatal, but is it possible to improve the error?
Metadata
Metadata
Assignees
Labels
NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.Feedback is required from experts, contributors, and/or the community before a change can be made.