Skip to content

Commit 0db7c53

Browse files
authored
Merge pull request #234 from orgads/insecure-cert
Ignore OAuth certificate errors when insecure is set
2 parents 9e200d3 + 855ad81 commit 0db7c53

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

restapi/api_client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"strings"
1616
"time"
1717

18+
"golang.org/x/oauth2"
1819
"golang.org/x/oauth2/clientcredentials"
1920
"golang.org/x/time/rate"
2021
)
@@ -250,7 +251,8 @@ func (client *APIClient) sendRequest(method string, path string, data string) (s
250251
}
251252

252253
if client.oauthConfig != nil {
253-
tokenSource := client.oauthConfig.TokenSource(context.Background())
254+
ctx := context.WithValue(context.Background(), oauth2.HTTPClient, client.httpClient)
255+
tokenSource := client.oauthConfig.TokenSource(ctx)
254256
token, err := tokenSource.Token()
255257
if err != nil {
256258
return "", err

0 commit comments

Comments
 (0)