From 1d16eb700345015b49ab25ea5be0c4328285d87a Mon Sep 17 00:00:00 2001 From: Jay Zeschin Date: Wed, 19 Dec 2018 14:49:49 -0500 Subject: [PATCH] Increase timeouts to 60s to allow auth over slow connections (#103) --- lib/okta.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/okta.go b/lib/okta.go index aad42aef..bf4bb0aa 100644 --- a/lib/okta.go +++ b/lib/okta.go @@ -31,6 +31,8 @@ const ( // deprecated; use OktaServerUs OktaServer = OktaServerUs + + Timeout = time.Duration(60 * time.Second) ) type OktaClient struct { @@ -436,8 +438,13 @@ func (o *OktaClient) Get(method string, path string, data []byte, recv interface header = http.Header{} } + transCfg := &http.Transport{ + TLSHandshakeTimeout: Timeout, + } client = http.Client{ - Jar: o.CookieJar, + Transport: transCfg, + Timeout: Timeout, + Jar: o.CookieJar, } req := &http.Request{