From 16e85d6d5c56bbe631d182cab5dbd48964976062 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Wed, 3 Aug 2022 11:26:36 -0400 Subject: [PATCH] pass CA file to fetch_token so it's used by requests --- src/gam/auth/oauth.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gam/auth/oauth.py b/src/gam/auth/oauth.py index 72a104f9..d2b8c175 100644 --- a/src/gam/auth/oauth.py +++ b/src/gam/auth/oauth.py @@ -24,7 +24,10 @@ from gam import controlflow from gam import display from gam import fileutils from gam import transport -from gam.var import GM_Globals, GM_WINDOWS +from gam.var import GC_CA_FILE, + GC_Values, + GM_Globals, + GM_WINDOWS from gam import utils @@ -633,7 +636,10 @@ class _ShortURLFlow(google_auth_oauthlib.flow.InstalledAppFlow): parsed_params = parse_qs(parsed_url.query) code = parsed_params.get('code', [None])[0] try: - self.fetch_token(code=code) + fetch_args = {'code': code} + if GC_Values.get('GC_CA_FILE'): + fetch_args['verify'] = GC_Values.get('GC_CA_FILE') + self.fetch_token(**fetch_args) break except Exception as e: if not userInput: