Skip to content

Commit ec7664c

Browse files
ilia-meysakМейсак Илья Николаевич
andauthored
Update proxy logic to handle https protocol (#677)
Co-authored-by: Мейсак Илья Николаевич <[email protected]>
1 parent 1773b80 commit ec7664c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

google/ads/googleads/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def __init__(
329329

330330
# If given, write the http_proxy channel option for GRPC to use
331331
if http_proxy:
332-
_GRPC_CHANNEL_OPTIONS.append(("grpc.http_proxy", http_proxy)),
332+
_GRPC_CHANNEL_OPTIONS.append(("grpc.http_proxy", http_proxy))
333333

334334
def get_service(self, name, version=_DEFAULT_VERSION, interceptors=None):
335335
"""Returns a service client instance for the specified service_name.

google/ads/googleads/oauth2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ def initialize_credentials_wrapper(*args, **kwargs):
3939
credentials = func(*args, **kwargs)
4040
# If the configs contain an http_proxy, refresh credentials through the
4141
# proxy URI
42-
if kwargs.get("http_proxy"):
42+
proxy = kwargs.get("http_proxy")
43+
if proxy:
4344
session = Session()
44-
session.proxies.update({"http": kwargs.get("http_proxy")})
45+
session.proxies.update({"http": proxy, "https": proxy})
4546
credentials.refresh(Request(session=session))
4647
else:
4748
credentials.refresh(Request())

0 commit comments

Comments
 (0)