{"action":"closed","issue":{"url":"https://api.github.com/repos/golang/go/issues/17296","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/17296/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/17296/comments","events_url":"https://api.github.com/repos/golang/go/issues/17296/events","html_url":"https://github.com/golang/go/issues/17296","id":180271078,"number":17296,"title":"net/http: document when a Transport will not automatically upgrade to a HTTP/2 Transport","user":{"login":"noblehng","id":6649504,"avatar_url":"https://avatars.githubusercontent.com/u/6649504?v=3","gravatar_id":"","url":"https://api.github.com/users/noblehng","html_url":"https://github.com/noblehng","followers_url":"https://api.github.com/users/noblehng/followers","following_url":"https://api.github.com/users/noblehng/following{/other_user}","gists_url":"https://api.github.com/users/noblehng/gists{/gist_id}","starred_url":"https://api.github.com/users/noblehng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noblehng/subscriptions","organizations_url":"https://api.github.com/users/noblehng/orgs","repos_url":"https://api.github.com/users/noblehng/repos","events_url":"https://api.github.com/users/noblehng/events{/privacy}","received_events_url":"https://api.github.com/users/noblehng/received_events","type":"User","site_admin":false},"labels":[{"id":150880209,"url":"https://api.github.com/repos/golang/go/labels/Documentation","name":"Documentation","color":"aaffaa","default":false},{"id":373399998,"url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/38","html_url":"https://github.com/golang/go/milestones/Go1.8","labels_url":"https://api.github.com/repos/golang/go/milestones/38/labels","id":1709363,"number":38,"title":"Go1.8","description":"","creator":{"login":"griesemer","id":8528975,"avatar_url":"https://avatars.githubusercontent.com/u/8528975?v=3","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false},"open_issues":130,"closed_issues":585,"state":"open","created_at":"2016-04-15T16:30:23Z","updated_at":"2016-11-10T23:15:41Z","due_on":"2017-01-31T00:00:00Z","closed_at":null},"comments":1,"created_at":"2016-09-30T10:26:32Z","updated_at":"2016-11-10T23:15:41Z","closed_at":"2016-11-10T23:15:41Z","body":"Please answer these questions before submitting your issue. Thanks!\n### What version of Go are you using (`go version`)?\n\ngo version go1.7.1 linux/amd64\n### What operating system and processor architecture are you using (`go env`)?\n\namd64\n### What did you do?\n\nI'm trying to pinning a TLS cert for a HTTP/2 server, so I have a custom `http.Transport` with its TLSClientConfig set like:\n\n``` go\n TLSClientConfig: &tls.Config{\n     RootCAs:    pool,\n     NextProtos: []string{\"h2\", \"http/1.1\"},\n},\n```\n### What did you expect to see?\n\nFrom current documentation, `TLSNextProto` is nil, so the transport should be upgraded to HTTP/2 automatically and the request to the server should success.\n### What did you see instead?\n\nThe request failed with:\n\n``` shell\nhttp2: server: error reading preface from client 127.0.0.1:36682: bogus greeting \"GET / HTTP/1.1\\r\\nHost: 12\"\n```\n\nIt still use a http/1.1 transport after negotiated for h2.\n\nIt turns out that after the change with https://github.com/golang/go/issues/14275, if either `TLSClientConfig` or `Dial` or `DialTLS` is set for a `http.Transport`, the automatically upgrade [will not happen](https://github.com/golang/go/blob/c1e06dcb611822ba3c881b170f278d18237372c9/src/net/http/transport.go#L202). But the current documentation of `http.Transport` doesn't mention this.\n"}}
{"actor":{"display_login":"gopherbot"}}