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

net/http: changing Transport.Dial to DialContext opts in to HTTP/2 #27011

EvanMGates opened this Issue Aug 15, 2018 · 3 comments


None yet
5 participants
Copy link

EvanMGates commented Aug 15, 2018

What did you do?

We changed http.Client from using the deprecated transport.Dial function to its replacement, transport.DialContext.

What did you expect to see?

Dial and DialContext should behave similarly when using the same parameters.

What did you see instead?

Using DialContext causes Transport to be configured for http/2. The custom dialer DialContext should not automatically enable http2 as specified in the comment at

Does this issue reproduce with the latest release (go1.10.3)?

We noticed this issue in Go 1.10.2 and the offending code hasn't changed in Go 1.10.3.

System details

We deploy our code on linux/amd64.

We will submit a patch for this issue shortly.

@andybons andybons added this to the Unplanned milestone Aug 16, 2018


This comment has been minimized.

Copy link

andybons commented Aug 16, 2018

@bradfitz bradfitz added the NeedsFix label Aug 16, 2018

@bradfitz bradfitz modified the milestones: Unplanned, Go1.12 Aug 16, 2018


This comment has been minimized.

Copy link

gopherbot commented Aug 21, 2018

Change mentions this issue: net/http: restrict automatic HTTP/2 transport when using DialContext


This comment has been minimized.

Copy link

riking commented Aug 26, 2018

I thought this was specified in reverse, that using Dial instead of DialContext blocks the use of h2?

@andybons andybons modified the milestones: Go1.12, Go1.13 Feb 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.