From 45b63e2d4538d8b0cf273821872a22f6d5e0e74f Mon Sep 17 00:00:00 2001 From: Mark Spieth Date: Sun, 22 Mar 2020 23:28:19 +1100 Subject: [PATCH] oauth: Use custom http client so that --no-check-certificate is honored by oauth token fetch Fixes #4085 --- lib/oauthutil/oauthutil.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/oauthutil/oauthutil.go b/lib/oauthutil/oauthutil.go index 61e1efb55..74761e9ba 100644 --- a/lib/oauthutil/oauthutil.go +++ b/lib/oauthutil/oauthutil.go @@ -503,7 +503,8 @@ func doConfig(id, name string, m configmap.Mapper, oauthConfig *oauth2.Config, o } // Exchange the code for a token - token, err := oauthConfig.Exchange(context.Background(), auth.Code) + ctx := Context(fshttp.NewClient(fs.Config)) + token, err := oauthConfig.Exchange(ctx, auth.Code) if err != nil { return errors.Wrap(err, "failed to get token") }