-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
net/http: error message in case of bad certificate leaks implementation details in Go 1.13 #34066
Comments
If you write tests that compare error string values for exact matches, don't you already run into failures every other Go release? |
@mvdan No, it works consistently at least from go1.11.x. Also, go1.13 does not have the issue without I chased down the code and point to https://github.com/golang/go/blob/release-branch.go1.13/src/net/http/transport.go#L2060 It seems that |
I tend to agree with @mvdan that tests should not rely on the error strings. On the other hand, the fact that the string now contains |
CC @bradfitz @dmitshur @ianlancetaylor, plus @FiloSottile for TLS. |
I think what changed is that the TLS error used to be returned by This is not a regression because we don't guarantee error messages across versions, but we should figure out the |
@FiloSottile From I observed, the error seems to be the same, but the condition
|
I agree that an error message reported back to the user for a failure like this shouldn't say I also agree that this test should be fixed to not expect a specific error message. The Go 1 compatibility guarantee does not extend to the exact text of error messages. Especially not from the net/http package. |
In that CL, the new
If |
I fixed the test already. I just want to insist that something internal was changed, because the test is still passed without |
Until golang/go#34066 is fixed. Update #1153
Until golang/go#34066 is fixed. Update #1153
I'm trying digging more into this problem. As I can see, with Line 1920 in 6ba0be1
becomes true. The only place that increase Line 2363 in 6ba0be1
Without race, roundTrip always happens before readLoop. What's the right logic for |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Test passed.
What did you see instead?
Test failed.
Note
-race
.linux/amd64
.The text was updated successfully, but these errors were encountered: