diff options
author | Mike Crute <mike@crute.us> | 2017-09-05 03:52:50 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2017-09-05 03:52:50 +0000 |
commit | b7867d9cf5b0dd175b8167a552b830ebfe47d0ed (patch) | |
tree | 4b52c7461c7d9c48d68bec78cac6d06ae5940d28 /cautious_http_client.go | |
parent | 34d0f2d7e323acdc48cf91b0dc8514b6753de5d5 (diff) | |
download | oidc_proxy-b7867d9cf5b0dd175b8167a552b830ebfe47d0ed.tar.bz2 oidc_proxy-b7867d9cf5b0dd175b8167a552b830ebfe47d0ed.tar.xz oidc_proxy-b7867d9cf5b0dd175b8167a552b830ebfe47d0ed.zip |
Finish JWS and Cert validation
Diffstat (limited to 'cautious_http_client.go')
-rw-r--r-- | cautious_http_client.go | 13 |
1 files changed, 6 insertions, 7 deletions
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 | |||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "encoding/json" | 4 | "encoding/json" |
5 | "fmt" | ||
5 | "net" | 6 | "net" |
6 | "net/http" | 7 | "net/http" |
7 | "net/url" | 8 | "net/url" |
@@ -28,9 +29,9 @@ func NewCautiousHTTPClient() CautiousHTTPClient { | |||
28 | }).DialContext, | 29 | }).DialContext, |
29 | MaxIdleConns: 100, | 30 | MaxIdleConns: 100, |
30 | IdleConnTimeout: 90 * time.Second, | 31 | IdleConnTimeout: 90 * time.Second, |
31 | TLSHandshakeTimeout: 3 * time.Second, | 32 | TLSHandshakeTimeout: 1 * time.Second, |
32 | ExpectContinueTimeout: 1 * time.Second, | 33 | ExpectContinueTimeout: 1 * time.Second, |
33 | ResponseHeaderTimeout: 5 * time.Second, | 34 | ResponseHeaderTimeout: 10 * time.Second, |
34 | MaxResponseHeaderBytes: 500000, // .5 MB | 35 | MaxResponseHeaderBytes: 500000, // .5 MB |
35 | } | 36 | } |
36 | 37 | ||
@@ -49,11 +50,9 @@ func (c *cautiousHttpClient) Get(gurl string) (*http.Response, error) { | |||
49 | } | 50 | } |
50 | 51 | ||
51 | // TODO | 52 | // TODO |
52 | /* | 53 | if u.Scheme != "https" && false { |
53 | if u.Scheme != "https" { | 54 | return nil, fmt.Errorf("URL for GET must be secure") |
54 | return nil, fmt.Errorf("URL for GET must be secure") | 55 | } |
55 | } | ||
56 | */ | ||
57 | 56 | ||
58 | r, err := c.client.Get(u.String()) | 57 | r, err := c.client.Get(u.String()) |
59 | if err != nil { | 58 | if err != nil { |