You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, on older docker clients ( < docker 1.10) docker was setting an invalid host header when using unix sockets. Go versions prior to 1.6 accepted this header just fine, go 1.6 does not.
This was fixed in the Docker 1.10 client, however is a problem for older clients talking to docker binary compiled against go 1.6.
With the invalid host header, golang 1.6 (correctly) causes the http server in the docker daemon to reject the request with:
400 Bad Request: malformed Host header
This is obviously a bug in the older Docker clients, but it means that newer versions of Docker daemon can not be compiled with go 1.6 unless we decide to break compatibility with older clients or have some nasty hacks in the http server.
"Older" clients here means clients that are as young as 4 months old, currently.
What did you expect to see?
Unsure.
The Go 1.6 behavior is the "correct" behavior for dealing with the invalid header.
Ideally, I think we would like to be able to have a path to upgrade to 1.6 (and beyond) without breaking compatibility with older clients.
Definitely open to suggestions.
What did you see instead?
The old, invalid host headers are rejected by the http server with:
400 Bad Request: malformed Host header
The text was updated successfully, but these errors were encountered:
I believe the bug you're looking for is #14952 ("net/http: add switches to accept/send bogus HTTP"), so you could in theory opt-in to accepting garbage in your server.
But there's zero chance of that being backported to a Go 1.6.x version, and I'm undecided on #14952 anyway, plus time is running out for Go 1.7.
So, I think your best bet might be a unix domain socket proxy which replaces Host: /var/run/docker.sock\r\n to Host: \r\n or something. (Maybe it's a bit trickier; I'm not sure whether you use the unix socket in trickier ways, though, using it for auth or sending file descriptors or something.)
go version
)?1.6
go env
)?See Pre-golang 1.6 Dockers can't talk to golang 1.6 Docker moby/moby#20865
Basically, on older docker clients ( < docker 1.10) docker was setting an invalid host header when using unix sockets. Go versions prior to 1.6 accepted this header just fine, go 1.6 does not.
This was fixed in the Docker 1.10 client, however is a problem for older clients talking to docker binary compiled against go 1.6.
With the invalid host header, golang 1.6 (correctly) causes the http server in the docker daemon to reject the request with:
This is obviously a bug in the older Docker clients, but it means that newer versions of Docker daemon can not be compiled with go 1.6 unless we decide to break compatibility with older clients or have some nasty hacks in the http server.
"Older" clients here means clients that are as young as 4 months old, currently.
Unsure.
The Go 1.6 behavior is the "correct" behavior for dealing with the invalid header.
Ideally, I think we would like to be able to have a path to upgrade to 1.6 (and beyond) without breaking compatibility with older clients.
Definitely open to suggestions.
The old, invalid host headers are rejected by the http server with:
The text was updated successfully, but these errors were encountered: