Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

oauth: Use custom http client so that --no-check-certificate is honored by oauth token fetch

Mark Spieth45b63e2d4538
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")
}