Work around issue with UNIX domain sockets in api.Client addresses (#22523)

The Host part of the URL doesn't actually get used when we initiate connections to UNIX domain sockets.  As of https://github.com/golang/go/issues/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.
This commit is contained in:
Nick Cabatoff 2023-08-23 11:05:03 -04:00 committed by GitHub
parent e4ce8729fd
commit e29d98aadb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -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")

3
changelog/22523.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:bug
api: Fix breakage with UNIX domain socket addresses introduced by newest Go versions as a security fix.
```