Skip to content

Commit

Permalink
Merge pull request #234 from orgads/insecure-cert
Browse files Browse the repository at this point in the history
Ignore OAuth certificate errors when insecure is set
  • Loading branch information
DRuggeri authored Aug 22, 2023
2 parents 9e200d3 + 855ad81 commit 0db7c53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion restapi/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"strings"
"time"

"golang.org/x/oauth2"
"golang.org/x/oauth2/clientcredentials"
"golang.org/x/time/rate"
)
Expand Down Expand Up @@ -250,7 +251,8 @@ func (client *APIClient) sendRequest(method string, path string, data string) (s
}

if client.oauthConfig != nil {
tokenSource := client.oauthConfig.TokenSource(context.Background())
ctx := context.WithValue(context.Background(), oauth2.HTTPClient, client.httpClient)
tokenSource := client.oauthConfig.TokenSource(ctx)
token, err := tokenSource.Token()
if err != nil {
return "", err
Expand Down

0 comments on commit 0db7c53

Please sign in to comment.