woob.browser.adapters

class HTTPAdapter(*args, **kwargs)[source]

Bases: HTTPAdapter

Custom Adapter class with extra features.

Parameters:

proxy_headers (dict) – headers to send to proxy (if any)

add_proxy_header(key, value)[source]
update_proxy_headers(headers)[source]
proxy_headers(proxy)[source]

Returns a dictionary of the headers to add to any request sent through a proxy. This works with urllib3 magic to ensure that they are correctly sent to the proxy, rather than in a tunnelled request if CONNECT is being used.

This should not be called from user code, and is only exposed for use when subclassing the HTTPAdapter.

Parameters:

proxy – The url of the proxy being used for this request.

Return type:

dict

class LowSecHTTPAdapter(*args, **kwargs)[source]

Bases: HTTPAdapter

Adapter to use with low security HTTP servers.

Some websites uses small DH keys, which is deemed insecure by OpenSSL’s default config. we have to lower its expectations so it accepts the certificate.

See https://www.ssllabs.com/ssltest/analyze.html?d=www.ibps.bpaura.banquepopulaire.fr for the exhaustive list of defects they are too incompetent to fix

init_poolmanager(*args, **kwargs)[source]

Initializes a urllib3 PoolManager.

This method should not be called from user code, and is only exposed for use when subclassing the HTTPAdapter.

Parameters:
  • connections – The number of urllib3 connection pools to cache.

  • maxsize – The maximum number of connections to save in the pool.

  • block – Block when no free connections are available.

  • pool_kwargs – Extra keyword arguments used to initialize the Pool Manager.

proxy_manager_for(*args, **kwargs)[source]

Return urllib3 ProxyManager for the given proxy.

This method should not be called from user code, and is only exposed for use when subclassing the HTTPAdapter.

Parameters:
  • proxy – The proxy to return a urllib3 ProxyManager for.

  • proxy_kwargs – Extra keyword arguments used to configure the Proxy Manager.

Returns:

ProxyManager

Return type:

urllib3.ProxyManager