Skip to content

Commit 226abd6

Browse files
committed
Use DefaultClient as a http client
1 parent 98a3c24 commit 226abd6

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

0 commit comments

Comments
 (0)