Skip to content

Commit 3ffb93e

Browse files
committed
Use DefaultClient as a http client
1 parent 1ab32ac commit 3ffb93e

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

locksmithctl/locksmithctl.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ import (
2020
"flag"
2121
"fmt"
2222
"io/ioutil"
23-
"net"
2423
"net/http"
2524
"os"
2625
"path"
2726
"strings"
2827
"text/tabwriter"
29-
"time"
3028

3129
"github.com/flatcar-linux/locksmith/version"
3230

@@ -181,15 +179,7 @@ func main() {
181179
func getClient() (*client.Client, error) {
182180
// copy of github.com/coreos/etcd/client.DefaultTransport so that
183181
// TLSClientConfig can be overridden.
184-
transport := &http.Transport{
185-
Proxy: http.ProxyFromEnvironment,
186-
Dial: (&net.Dialer{
187-
Timeout: 30 * time.Second,
188-
KeepAlive: 30 * time.Second,
189-
}).Dial,
190-
TLSHandshakeTimeout: 10 * time.Second,
191-
}
192-
182+
transport := http.DefaultClient
193183
if globalFlags.EtcdCAFile != "" || globalFlags.EtcdCertFile != "" || globalFlags.EtcdKeyFile != "" {
194184
cert, err := tls.LoadX509KeyPair(globalFlags.EtcdCertFile, globalFlags.EtcdKeyFile)
195185
if err != nil {

0 commit comments

Comments
 (0)