mirror of https://github.com/status-im/consul.git
api: create fresh http client for unix sockets (#8602)
Co-authored-by: Matt Keeler <mkeeler@users.noreply.github.com>
This commit is contained in:
parent
cd9398aedc
commit
9fab3fe990
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
api: Allow for the client to use TLS over a Unix domain socket.
|
||||
```
|
|
@ -607,9 +607,11 @@ func NewClient(config *Config) (*Client, error) {
|
|||
trans.DialContext = func(_ context.Context, _, _ string) (net.Conn, error) {
|
||||
return net.Dial("unix", parts[1])
|
||||
}
|
||||
config.HttpClient = &http.Client{
|
||||
Transport: trans,
|
||||
httpClient, err := NewHttpClient(trans, config.TLSConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
config.HttpClient = httpClient
|
||||
default:
|
||||
return nil, fmt.Errorf("Unknown protocol scheme: %s", parts[0])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue