From b3d862512b949995ff1c83634af3fe2cbc45ab62 Mon Sep 17 00:00:00 2001 From: Adam Miller Date: Sat, 10 Oct 2020 16:40:00 -0400 Subject: [PATCH] Fix AsyncTransport verify_ssl and proxy --- src/zeep/transports.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/zeep/transports.py b/src/zeep/transports.py index 203bbd264..91d92378f 100644 --- a/src/zeep/transports.py +++ b/src/zeep/transports.py @@ -179,14 +179,18 @@ def __init__( raise RuntimeError("The AsyncTransport is based on the httpx module") self.cache = cache - self.wsdl_client = wsdl_client or httpx.Client() - self.client = client or httpx.AsyncClient() - self.load_timeout = timeout - self.operation_timeout = operation_timeout + self.wsdl_client = wsdl_client or httpx.Client( + verify=verify_ssl, + proxies=proxy, + timeout=timeout, + ) + self.client = client or httpx.AsyncClient( + verify=verify_ssl, + proxies=proxy, + timeout=operation_timeout, + ) self.logger = logging.getLogger(__name__) - self.verify_ssl = verify_ssl - self.proxy = proxy self.wsdl_client.headers = { "User-Agent": "Zeep/%s (www.python-zeep.org)" % (get_version()) } @@ -198,7 +202,7 @@ async def aclose(self): await self.client.aclose() def _load_remote_data(self, url): - response = self.wsdl_client.get(url, timeout=self.load_timeout) + response = self.wsdl_client.get(url) result = response.read() try: @@ -213,9 +217,6 @@ async def post(self, address, message, headers): address, data=message, headers=headers, - # verify=self.verify_ssl, - # proxy=self.proxy, - timeout=self.operation_timeout, ) self.logger.debug( "HTTP Response from %s (status: %d):\n%s", @@ -235,9 +236,6 @@ async def get(self, address, params, headers): address, params=params, headers=headers, - verify_ssl=self.verify_ssl, - proxy=self.proxy, - timeout=self.operation_timeout, ) return self.new_response(response)