diff --git a/google/auth/impersonated_credentials.py b/google/auth/impersonated_credentials.py index 4d0c4f0f1..f978b64ef 100644 --- a/google/auth/impersonated_credentials.py +++ b/google/auth/impersonated_credentials.py @@ -288,9 +288,12 @@ def sign_bytes(self, message): authed_session = AuthorizedSession(self._source_credentials) - response = authed_session.post( - url=iam_sign_endpoint, headers=headers, json=body - ) + try: + response = authed_session.post( + url=iam_sign_endpoint, headers=headers, json=body + ) + finally: + authed_session.close() if response.status_code != http_client.OK: raise exceptions.TransportError( diff --git a/system_tests/secrets.tar.enc b/system_tests/secrets.tar.enc index e8785c796..37a9d6a1e 100644 Binary files a/system_tests/secrets.tar.enc and b/system_tests/secrets.tar.enc differ