Skip to content

Commit

Permalink
fix: use expected TLS config, closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
ViRb3 committed Apr 16, 2020
1 parent 7940515 commit 11095ad
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cloudflare/util/web.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package util

import (
"crypto/tls"
"encoding/json"
"fmt"
"github.com/pkg/errors"
Expand All @@ -17,12 +18,12 @@ func applyDefaultHeaders(request *http.Request) {
}
}

var client = http.Client{}

func init() {
//proxyUrl, _ := url.Parse("http://127.0.0.1:8888")
//client.Transport = &http.Transport{Proxy: http.ProxyURL(proxyUrl)}
}
var client = http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
// Match app's TLS config or API will reject us with code 403 error 1020
MinVersion: tls.VersionTLS10,
MaxVersion: tls.VersionTLS12}}}

func NewAuthenticatedRequest(method string, url string, body io.Reader, accessToken string, result interface{}) error {
request, err := newRequest(method, url, body, accessToken)
Expand Down

1 comment on commit 11095ad

@kiding
Copy link

@kiding kiding commented on 11095ad Apr 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Please sign in to comment.