Skip to content

Commit

Permalink
Force TLS negotiation to only support HTTP/1.1
Browse files Browse the repository at this point in the history
Seems OKTA has a broken implementation of HTTP2?
There seem to be some quirks with they way golang handles HTTP2 requests (specifically when receiving GOAWAY frames) golang/go#20979, which result in the HTTP2 connection not terminating.
  • Loading branch information
mvallaly-rally committed Sep 29, 2020
1 parent 98c40a4 commit 5fea37c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/okta.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package lib

import (
"bytes"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -578,10 +579,19 @@ func (o *OktaClient) Get(method string, path string, data []byte, recv interface
}
}

// FORCE TLS negotiation to only support HTTP/1.1
tlsCfg := &tls.Config{
NextProtos: []string{"h1"},
}

transCfg := &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSHandshakeTimeout: Timeout,
DisableKeepAlives: true,
MaxIdleConnsPerHost: -1,
TLSClientConfig: tlsCfg,
}

client = http.Client{
Transport: transCfg,
Timeout: Timeout,
Expand Down

0 comments on commit 5fea37c

Please sign in to comment.