Skip to content

Commit

Permalink
Work around issue with UNIX domain sockets in api.Client addresses (#…
Browse files Browse the repository at this point in the history
…22523)

The Host part of the URL doesn't actually get used when we initiate connections to UNIX domain sockets.  As of golang/go#60374 (in the latest Go releases at the time of this writing), we must set it to something that looks like a hostname or requests will fail.
  • Loading branch information
ncabatoff committed Aug 23, 2023
1 parent e4ce872 commit e29d98a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/client.go
Expand Up @@ -545,7 +545,7 @@ func (c *Config) ParseAddress(address string) (*url.URL, error) {
// be pointing to the protocol used in the application layer and not to
// the transport layer. Hence, setting the fields accordingly.
u.Scheme = "http"
u.Host = socket
u.Host = "localhost"
u.Path = ""
} else {
return nil, fmt.Errorf("attempting to specify unix:// address with non-transport transport")
Expand Down
3 changes: 3 additions & 0 deletions changelog/22523.txt
@@ -0,0 +1,3 @@
```release-note:bug
api: Fix breakage with UNIX domain socket addresses introduced by newest Go versions as a security fix.
```

0 comments on commit e29d98a

Please sign in to comment.