Skip to content

Commit

Permalink
Revert "cert: make roundtrip more robust"
Browse files Browse the repository at this point in the history
This reverts commit 10e5102.
  • Loading branch information
magiconair committed Jan 9, 2018
1 parent 10e5102 commit b5202c3
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions cert/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,25 +594,20 @@ func roundtrip(serverName string, srvConfig *tls.Config, client *http.Client) (c
// configure SNI
client.Transport.(*http.Transport).TLSClientConfig.ServerName = serverName

deadline := time.Now().Add(500 * time.Millisecond)
for time.Now().Before(deadline) {
time.Sleep(25 * time.Millisecond)
// give the tls server some time to start up
time.Sleep(10 * time.Millisecond)

var resp *http.Response
resp, err = client.Get(srv.URL)
if err != nil {
continue
}
resp, err := client.Get(srv.URL)
if err != nil {
return 0, "", err
}
defer resp.Body.Close()

var data []byte
data, err = ioutil.ReadAll(resp.Body)
if err != nil {
continue
}
resp.Body.Close()
return resp.StatusCode, string(data), nil
data, err := ioutil.ReadAll(resp.Body)
if err != nil {
return 0, "", err
}
return
return resp.StatusCode, string(data), nil
}

// http11Client returns an HTTP client which can only
Expand Down

0 comments on commit b5202c3

Please sign in to comment.