I have a desktop application written in python which uses aiohttp package to make api calls. So the problem I am facing is the api calls works perfectly when there is no proxy settings but when we install our app on a system which use proxy settings the api fails.
Cannot connect to host api.abc.com:443 ssl:default [getaddrinfo failed]
I have read many articles but none define how to use system proxy settings. Few recommend to use trust_env but it does not work
async with aiohttp.ClientSession(trust_env=True) as session:
async with session.post(url, json=body, headers=headers) as response:
data = await response.read()
data = json.loads(data.decode("utf-8"))
return response.status, data
Environment:
System settings are set by Zscalar
Python 3.8
aiohttp 3.8.1
Windows 10 pro 64 bit