Skip to content

Commit

Permalink
Use DefaultClient as a http client
Browse files Browse the repository at this point in the history
  • Loading branch information
aniruddha2000 committed Oct 26, 2021
1 parent 98a3c24 commit 226abd6
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions locksmithctl/locksmithctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ import (
"flag"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"path"
"strings"
"text/tabwriter"
"time"

"github.com/flatcar-linux/locksmith/version"
"github.com/flatcar-linux/fleetlock/pkg/client"
Expand Down Expand Up @@ -180,15 +178,7 @@ func main() {
func getClient() (*client.Client, error) {
// copy of github.com/coreos/etcd/client.DefaultTransport so that
// TLSClientConfig can be overridden.
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
}

transport := http.DefaultClient
if globalFlags.EtcdCAFile != "" || globalFlags.EtcdCertFile != "" || globalFlags.EtcdKeyFile != "" {
cert, err := tls.LoadX509KeyPair(globalFlags.EtcdCertFile, globalFlags.EtcdKeyFile)
if err != nil {
Expand Down

0 comments on commit 226abd6

Please sign in to comment.