Skip to content

Commit

Permalink
Remove unnecessary settings and support Go 1.4, 1.5 and 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
pdellaert committed Mar 31, 2017
1 parent 2f8190c commit a8550c9
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions bambou/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"encoding/base64"
"encoding/json"
"io/ioutil"
"net"
"net/http"
"strconv"
"strings"
Expand Down Expand Up @@ -82,16 +81,8 @@ type Session struct {
func NewSession(username, password, organization, url string, root Rootable) *Session {

tr := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 20,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
Proxy: http.ProxyFromEnvironment,
TLSHandshakeTimeout: 10 * time.Second,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
Expand All @@ -110,16 +101,8 @@ func NewSession(username, password, organization, url string, root Rootable) *Se
func NewX509Session(cert *tls.Certificate, url string, root Rootable) *Session {

tr := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 20,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
Proxy: http.ProxyFromEnvironment,
TLSHandshakeTimeout: 10 * time.Second,
TLSClientConfig: &tls.Config{
Certificates: []tls.Certificate{*cert},
InsecureSkipVerify: true,
Expand Down

0 comments on commit a8550c9

Please sign in to comment.