requests.packages.urllib3.poolmanager.PoolManager

Here are the examples of the python api requests.packages.urllib3.poolmanager.PoolManager taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

24 Examples 7

Example 1

Project: pixelated-user-agent
Source File: tls_adapter.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize,
                                       block=block,
                                       assert_hostname=self._assert_hostname,
                                       assert_fingerprint=self._assert_fingerprint,
                                       cert_reqs=ssl.CERT_REQUIRED)

Example 2

Project: python-jss
Source File: tlsadapter.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        """Set up a poolmanager to use TLS and our cipher list."""
        self.poolmanager = PoolManager(
            num_pools=connections, maxsize=maxsize, block=block,
            ssl_version=ssl.PROTOCOL_TLSv1)   # pylint: disable=no-member
        pyopenssl.DEFAULT_SSL_CIPHER_LIST = CIPHER_LIST

Example 3

Project: smartsheet-python-sdk
Source File: session.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       cert_reqs=ssl.CERT_REQUIRED,
                                       ca_certs=_TRUSTED_CERT_FILE,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 4

Project: xbmc-nhl-gamecenter
Source File: TLSAdapter.py
View license
	def init_poolmanager(self, connections, maxsize, block=False):
		self.poolmanager = PoolManager(
			num_pools = connections,
			maxsize = maxsize,
			block = block,
			ssl_version = self.tls_version
		)

Example 5

Project: packtSnatch
Source File: packtSnatch.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
    	""" Supports the TLSv1 """
        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 6

Project: inspectors-general
Source File: utils.py
View license
  def init_poolmanager(self, connections, maxsize, block=False):
    self.poolmanager = requests.packages.urllib3.poolmanager.PoolManager\
      (num_pools=connections,
       maxsize=maxsize,
       block=block,
       ssl_version=ssl.PROTOCOL_TLSv1)

Example 7

View license
    def init_poolmanager(self, connections, maxsize, block=False):
        ssl_version = ssl.PROTOCOL_TLSv1 if sys.version_info < (2, 7, 9) or sys.version_info[0:2] == (3, 3) \
                                         else ssl.PROTOCOL_SSLv23
        self.poolmanager = PoolManager(
            num_pools=connections,
            maxsize=maxsize,
            block=block,
            ssl_version=ssl_version
        )

Example 8

View license
    def init_poolmanager(self, connections, maxsize, block=False):
        ssl_version = ssl.PROTOCOL_TLSv1 if sys.version_info < (2, 7, 9) or sys.version_info[0:2] == (3, 3) \
                                         else ssl.PROTOCOL_SSLv23
        self.poolmanager = PoolManager(
            num_pools=connections,
            maxsize=maxsize,
            block=block,
            ssl_version=ssl_version
        )

Example 9

Project: dropbox-sdk-python
Source File: session.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       cert_reqs=ssl.CERT_REQUIRED,
                                       ca_certs=_TRUSTED_CERT_FILE,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 10

Project: KeenClient-Python
Source File: api.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):

        """ Initialize pool manager with forced TLSv1 support. """

        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 11

Project: KeenClient-Python
Source File: api.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):

        """ Initialize pool manager with forced TLSv1 support. """

        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 12

Project: p2p-python
Source File: adapters.py
View license
    def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK):
        self._pool_connections = connections
        self._pool_maxsize = maxsize
        self._pool_block = block

        self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize,
                                       block=block,
                                       ssl_version='TLSv1')

Example 13

Project: p2p-python
Source File: adapters.py
View license
    def init_poolmanager(self, connections, maxsize, block=DEFAULT_POOLBLOCK):
        self._pool_connections = connections
        self._pool_maxsize = maxsize
        self._pool_block = block

        self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize,
                                       block=block,
                                       ssl_version='TLSv1')

Example 14

Project: screencloud-plugins
Source File: session.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       cert_reqs=ssl.CERT_REQUIRED,
                                       ca_certs=_TRUSTED_CERT_FILE,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 15

Project: python-social-auth
Source File: utils.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(
            num_pools=connections,
            maxsize=maxsize,
            block=block,
            ssl_version=self.ssl_protocol
        )

Example 16

Project: pixelated-dispatcher
Source File: __init__.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize,
                                       block=block, ssl_version=latest_available_ssl_version())

Example 17

Project: three
Source File: core.py
View license
    def init_poolmanager(self, connections, maxsize):
        self.poolmanager = requests.packages.urllib3.poolmanager.PoolManager(
            num_pools=connections,
            maxsize=maxsize,
            ssl_version=self.ssl_version)

Example 18

Project: datasift-python
Source File: requests_ssl.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 19

Project: OdooQuant
Source File: helpers.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 20

Project: jc-nest
Source File: nest.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        self.poolmanager = PoolManager(num_pools=connections,
                                       maxsize=maxsize,
                                       block=block,
                                       ssl_version=ssl.PROTOCOL_TLSv1)

Example 21

Project: requests-middleware
Source File: middleware.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        """Assemble keyword arguments to be passed to `PoolManager`.
        Middlewares are called in reverse order, so if multiple middlewares
        define conflicting arguments, the higher-priority middleware will take
        precedence. Note: Arguments are passed directly to `PoolManager` and
        not to the superclass `init_poolmanager` because the superclass method
        does not currently accept **kwargs.
        """
        kwargs = {}
        for middleware in self.middlewares[::-1]:
            value = middleware.before_init_poolmanager(
                connections, maxsize, block
            )
            kwargs.update(value or {})

        self._pool_connections = connections
        self._pool_maxsize = maxsize
        self._pool_block = block

        self.poolmanager = PoolManager(
            num_pools=connections, maxsize=maxsize, block=block,
            **kwargs
        )

Example 22

Project: requests-middleware
Source File: middleware.py
View license
    def init_poolmanager(self, connections, maxsize, block=False):
        """Assemble keyword arguments to be passed to `PoolManager`.
        Middlewares are called in reverse order, so if multiple middlewares
        define conflicting arguments, the higher-priority middleware will take
        precedence. Note: Arguments are passed directly to `PoolManager` and
        not to the superclass `init_poolmanager` because the superclass method
        does not currently accept **kwargs.
        """
        kwargs = {}
        for middleware in self.middlewares[::-1]:
            value = middleware.before_init_poolmanager(
                connections, maxsize, block
            )
            kwargs.update(value or {})

        self._pool_connections = connections
        self._pool_maxsize = maxsize
        self._pool_block = block

        self.poolmanager = PoolManager(
            num_pools=connections, maxsize=maxsize, block=block,
            **kwargs
        )

Example 23

Project: wxbanker
Source File: api.py
View license
    def init_poolmanager(self, connections, maxsize, **kwargs):
        self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize, **kwargs)

Example 24

Project: wxbanker
Source File: api.py
View license
    def init_poolmanager(self, connections, maxsize, **kwargs):
        self.poolmanager = PoolManager(num_pools=connections, maxsize=maxsize, **kwargs)