Closed freezix closed 1 year ago
Hello
So far, it is not possible to use a proxy with an authentication
demisto-py/demisto_client/demisto_api/rest.py line 86 if configuration.proxy: self.pool_manager = urllib3.ProxyManager( num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, ca_certs=ca_certs, cert_file=configuration.cert_file, key_file=configuration.key_file, proxy_url=configuration.proxy, **addition_pool_args )
if configuration.proxy: self.pool_manager = urllib3.ProxyManager( num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, ca_certs=ca_certs, cert_file=configuration.cert_file, key_file=configuration.key_file, proxy_url=configuration.proxy, **addition_pool_args )
For the auth, we would need the following configuration proxy_headers=urllib3.make_headers(proxy_basic_auth='user:pass')
parse the creds from the proxy defined when instanciating the api demisto_client.configure( ..., proxy='http://user:pass@ip:port')
add a configuration parameter demisto_client.configure(..., proxy='http://ip:port', proxy_credentials='user:pass')
Which solution is the best ? I can submit a PR then (would be my first)
@freezix Please contact your support partner, and they'll open a ticket internally for us, and we'll handle it.
Hello
So far, it is not possible to use a proxy with an authentication
demisto-py/demisto_client/demisto_api/rest.py line 86
if configuration.proxy: self.pool_manager = urllib3.ProxyManager( num_pools=pools_size, maxsize=maxsize, cert_reqs=cert_reqs, ca_certs=ca_certs, cert_file=configuration.cert_file, key_file=configuration.key_file, proxy_url=configuration.proxy, **addition_pool_args )
For the auth, we would need the following configuration proxy_headers=urllib3.make_headers(proxy_basic_auth='user:pass')
First option :
parse the creds from the proxy defined when instanciating the api demisto_client.configure( ..., proxy='http://user:pass@ip:port')
Second option :
add a configuration parameter demisto_client.configure(..., proxy='http://ip:port', proxy_credentials='user:pass')
Which solution is the best ? I can submit a PR then (would be my first)