Python SDK how to set a proxy

Thank you @mpotti for the good examples. Unfortunately with the configuration suggested the connection still does not seem to be going to the proxy.

What I find strange is that my normal Python script using the requests module works fine. It does not need any configuration around the proxy. I assume it is getting the proxy information from the system but I am not sure how that works. This is the working script without the SailPoint provided Python SDK:

# Credit for class and ssl: https://stackoverflow.com/questions/42982143/python-requests-how-to-use-system-ca-certificates-debian-ubuntu
# Credit for SailPoint API part: https://developer.sailpoint.com/discuss/t/python-authentication-example-with-jwt/16070/5
 
import ssl
import requests
from requests.adapters import HTTPAdapter
import os


class LocalSSLContext(HTTPAdapter):
    def init_poolmanager(self, *args, **kwargs):
        context = ssl.create_default_context()
        context.load_default_certs()
        kwargs['ssl_context'] = context
        return super(LocalSSLContext, self).init_poolmanager(*args, **kwargs)

# Set the necessary variables
tenant_id = os.environ.get("tenant_id")
client_id = os.environ.get("client_id")
client_secret = os.environ.get("client_secret")
base_url = f"https://{tenant_id}.api.identitynow.com"

# Get an access token
auth_url = f"{base_url}/oauth/token"
auth_data = {
    "grant_type": "client_credentials",
    "client_id": client_id,
    "client_secret": client_secret,
}

session = requests.Session()
sslContext = LocalSSLContext()
session.mount(base_url, sslContext)
response = session.post(url=auth_url, data=auth_data)
print(session.proxies)
print(response.status_code)

#Extract the access token from the response
access_token = response.json()["access_token"]

# API Call to get Sources
url = f"{base_url}/v3/sources"
headers = {
    'Authorization': f'Bearer {access_token}',
    'cache-control': 'no-cache',
	'Content-Type': 'application/json'
}

#response = requests.request("GET",url, headers=headers, verify=False)
response = session.get(url=url, headers=headers)

if response.status_code == 200:
    data = response.json()
  
else:
    print(f"Request for sources failed with status code: {response.status_code}")

session.close