From aea92be8d38e351f5cda475a8e76bc956a22a83b Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Fri, 7 Jun 2019 17:15:16 -0400 Subject: [PATCH 1/2] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 785dd232..f7f3f06c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -137,7 +137,6 @@ script: - if [ "$VMTYPE" == "build" ]; then $gam version | grep "Python ${BUILD_PYTHON_VERSION//./\\.}"; fi # We should be building with latest Python - if [ "$VMTYPE" == "build" ]; then $gam version extended | grep "OpenSSL ${BUILD_OPENSSL_VERSION//./\\.}"; fi # We should be using OpenSSL 1.1.1+ - if [ "$VMTYPE" == "build" ]; then $gam version extended | grep TLSv1\.[23]; fi # Builds should default TLS 1.2 or 1.3 to Google -- if [ "$VMTYPE" == "build" ]; then GAM_TLS_MIN_VERSION=TLSv1 GAM_TLS_MAX_VERSION=TLSv1 $gam version extended | grep TLSv1\.0; fi # Force TLS 1.0 - if [ "$VMTYPE" == "build" ]; then GAM_TLS_MIN_VERSION=TLSv1_2 $gam version extended location tls-v1-0.badssl.com:1010; [[ $? == 3 ]]; fi # expect fail if server doesn't support our TLS version - export jid="$(cut -d'.' -f2 <<<"$TRAVIS_JOB_NUMBER")" - if [ "$TRAVIS_EVENT_TYPE" != "pull_request" ]; then export e2e=true; fi From 5f48b1e16f0a6aa664495d40e28b4eb898a7c1d4 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 7 Jun 2019 16:15:31 -0700 Subject: [PATCH 2/2] httplib2 throws RuntimeError when OpenSSL is below 1.1 (#948) --- src/gam.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gam.py b/src/gam.py index a3514e4d..fc47c84f 100755 --- a/src/gam.py +++ b/src/gam.py @@ -801,7 +801,7 @@ def doGAMCheckForUpdates(forceCheck=False): sys.exit(0) writeFile(GM_Globals[GM_LAST_UPDATE_CHECK_TXT], str(now_time), continueOnError=True, displayError=forceCheck) return - except (httplib2.HttpLib2Error, httplib2.ServerNotFoundError): + except (httplib2.HttpLib2Error, httplib2.ServerNotFoundError, RuntimeError): return def doGAMVersion(checkForArgs=True): @@ -850,7 +850,7 @@ def _getServerTLSUsed(location): headers = {'user-agent': GAM_INFO} try: httpc.request(url, headers=headers) - except httplib2.ServerNotFoundError as e: + except (httplib2.ServerNotFoundError, RuntimeError) as e: systemErrorExit(4, e) cipher_name, tls_ver, _ = httpc.connections[conn].sock.cipher() return tls_ver, cipher_name @@ -1092,7 +1092,7 @@ def callGAPI(service, function, service._http.cache = None continue systemErrorExit(4, str(e)) - except (TypeError, httplib2.ServerNotFoundError) as e: + except (TypeError, httplib2.ServerNotFoundError, RuntimeError) as e: systemErrorExit(4, str(e)) def callGAPIpages(service, function, items='items', @@ -1282,7 +1282,7 @@ def getService(api, http): if GM_Globals[GM_CACHE_DISCOVERY_ONLY]: http.cache = None return service - except httplib2.ServerNotFoundError as e: + except (httplib2.ServerNotFoundError, RuntimeError) as e: systemErrorExit(4, str(e)) except (googleapiclient.errors.InvalidJsonError, KeyError, ValueError) as e: http.cache = None @@ -1413,7 +1413,7 @@ def buildGAPIServiceObject(api, act_as, showAuthError=True): try: credentials.refresh(request) service._http = google_auth_httplib2.AuthorizedHttp(credentials, http=http) - except httplib2.ServerNotFoundError as e: + except (httplib2.ServerNotFoundError, RuntimeError) as e: systemErrorExit(4, e) except google.auth.exceptions.RefreshError as e: if isinstance(e.args, tuple): @@ -1478,7 +1478,7 @@ def doCheckServiceAccount(users): request = google_auth_httplib2.Request(_createHttpObj()) credentials.refresh(request) result = 'PASS' - except httplib2.ServerNotFoundError as e: + except (httplib2.ServerNotFoundError, RuntimeError) as e: systemErrorExit(4, e) except google.auth.exceptions.RefreshError: result = 'FAIL'