Skip to content

Commit e29d98a

Browse files
authored
Work around issue with UNIX domain sockets in api.Client addresses (hashicorp#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.
1 parent e4ce872 commit e29d98a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

api/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ func (c *Config) ParseAddress(address string) (*url.URL, error) {
545545
// be pointing to the protocol used in the application layer and not to
546546
// the transport layer. Hence, setting the fields accordingly.
547547
u.Scheme = "http"
548-
u.Host = socket
548+
u.Host = "localhost"
549549
u.Path = ""
550550
} else {
551551
return nil, fmt.Errorf("attempting to specify unix:// address with non-transport transport")

changelog/22523.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
api: Fix breakage with UNIX domain socket addresses introduced by newest Go versions as a security fix.
3+
```

0 commit comments

Comments
 (0)