From b7867d9cf5b0dd175b8167a552b830ebfe47d0ed Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Tue, 5 Sep 2017 03:52:50 +0000 Subject: Finish JWS and Cert validation --- cautious_http_client.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'cautious_http_client.go') diff --git a/cautious_http_client.go b/cautious_http_client.go index 66179f2..2f33ae0 100644 --- a/cautious_http_client.go +++ b/cautious_http_client.go @@ -2,6 +2,7 @@ package main import ( "encoding/json" + "fmt" "net" "net/http" "net/url" @@ -28,9 +29,9 @@ func NewCautiousHTTPClient() CautiousHTTPClient { }).DialContext, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 3 * time.Second, + TLSHandshakeTimeout: 1 * time.Second, ExpectContinueTimeout: 1 * time.Second, - ResponseHeaderTimeout: 5 * time.Second, + ResponseHeaderTimeout: 10 * time.Second, MaxResponseHeaderBytes: 500000, // .5 MB } @@ -49,11 +50,9 @@ func (c *cautiousHttpClient) Get(gurl string) (*http.Response, error) { } // TODO - /* - if u.Scheme != "https" { - return nil, fmt.Errorf("URL for GET must be secure") - } - */ + if u.Scheme != "https" && false { + return nil, fmt.Errorf("URL for GET must be secure") + } r, err := c.client.Get(u.String()) if err != nil { -- cgit v1.2.3