Beispiel #1
0
 def __init__(self, host, port, key_file, cert_file, ca_file, timeout=None):
     HTTPSConnection.__init__(self, host, key_file=key_file, cert_file=cert_file)
     self.key_file = key_file
     self.cert_file = cert_file
     self.ca_file = ca_file
     self.timeout = timeout
     self.port = port
    def __init__(self, host, port=None, key_file=None, cert_file=None,
                 strict=None, cert_reqs=None, ca_certs=None,
                 check_hostname=None, ssl_version=None):
        '''

            :param host:        host to connect to (see :class:`httplib.HTTPConnection`)
            :param port:        port to connect to (see :class:`httplib.HTTPConnection`)
            :param key_file:        client ssl key file (see :class:`httplib.HTTPSConnection`)
            :param cert_file:        client ssl cert file (see :class:`httplib.HTTPSConnection`)
            :param strict:        HTTP response strictness (see :class:`httplib.HTTPConnection`)

            :param ca_certs:        CA certificates file to verify against, default is :attr:`self.ca_certs` (see :mod:`ssl`)
            :param cert_reqs:        Certificate requirement for peer, default is :attr:`self.cert_reqs` (see :mod:`ssl`)
            :param ssl_version: SSL protocol version to use, default is :attr:`ssl_version` (see :mod:`ssl`)

            :param check_hostname:        Whether hostname checking should be performed or not, default is :attr:`self.check_hostname`.  Hostnames are not checked if no certificate is validated.

            :raises: :exc:`NotImplementedError` if the :mod:`ssl` module is not available
        '''

        if not SSLSocket:
            raise NotImplementedError(_ssl_module_message)

        HTTPSConnection.__init__(self, host, port=port, key_file=key_file,
            cert_file=cert_file, strict=strict)
        if ca_certs is not None:
            self.ca_certs = ca_certs
        if ssl_version is not None:
            self.ssl_version = ssl_version
        if cert_reqs is not None:
            self.cert_reqs = cert_reqs
        if self.cert_reqs is None: # Is this logic implemented by the ssl class?
            self.cert_reqs = self.ca_certs and CERT_REQUIRED or CERT_NONE
        if check_hostname is not None:
            self.check_hostname = check_hostname
 def __init__(self, host, port=None, key_file=None,
              cert_file=None, timeout=None, strict=None):
     HTTPSConnection.__init__(
         self, host, port=port, key_file=key_file,
         cert_file=cert_file, timeout=timeout, strict=strict)
     self.key_file = key_file
     self.cert_file = cert_file
     self.timeout = timeout
Beispiel #4
0
    def __init__(self, host, port=None, ca_file=None, **kwargs):
        HTTPSConnection.__init__(self, host=host, port=port, **kwargs)

        if ca_file:
            self.ca_file = ca_file
        else:
            self.ca_file = os.path.join(os.path.dirname(__file__),
                                        'DigiCertRoots.pem')
Beispiel #5
0
    def __init__(self, host, port=None, key_file=None, cert_file=None,
                 strict=None,
                 timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                 connect_timeout=socket._GLOBAL_DEFAULT_TIMEOUT):

        HTTPSConnection.__init__(self, host, port=port, key_file=key_file,
                                 cert_file=cert_file, strict=strict, timeout=timeout)
        self.connect_timeout = connect_timeout
Beispiel #6
0
 def __init__(self,
              proxytype,
              proxyaddr,
              proxyport=None,
              rdns=True,
              username=None,
              password=None,
              *args,
              **kwargs):
     self.proxyargs = (proxytype, proxyaddr, proxyport, rdns, username,
                       password)
     HTTPSConnection.__init__(self, *args, **kwargs)
Beispiel #7
0
 def __init__(self, host, port=None, timeout=60, proxy=None):
     self.has_proxy = False
     self.request_host = host
     proxy = proxy or _get_proxy_from_env(host, varname="HTTPS_PROXY")
     if proxy:
         url = urlparse(proxy)
         if not url.hostname:
             url = urlparse('https://' + proxy)
         host = url.hostname
         port = url.port
         self.has_proxy = True
     HTTPSConnection.__init__(self, host, port, timeout=timeout)
     self.request_length = 0
Beispiel #8
0
 def __init__(self, host, port=None):
     self.has_proxy = False
     self.request_host = host
     https_proxy = os.environ.get('https_proxy') or os.environ.get('HTTPS_PROXY')
     if https_proxy:
         url = urlparse(https_proxy)
         if not url.hostname:
             url = urlparse('https://' + https_proxy)
         host = url.hostname
         port = url.port
         self.has_proxy = True
     HTTPSConnection.__init__(self, host, port)
     self.request_length = 0
 def __init__(self, host, port=None):
     self.has_proxy = False
     self.request_host = host
     https_proxy = (os.environ.get('https_proxy')
                    or os.environ.get('HTTPS_PROXY'))
     if https_proxy:
         url = urlparse(https_proxy)
         if not url.hostname:
             url = urlparse('https://' + https_proxy)
         host = url.hostname
         port = url.port
         self.has_proxy = True
     HTTPSConnection.__init__(self, host, port)
     self.request_length = 0
Beispiel #10
0
 def __init__(self,
              path,
              host,
              port,
              key_file,
              cert_file,
              ca_file,
              timeout=None):
     HTTPSConnection.__init__(self,
                              host,
                              key_file=key_file,
                              cert_file=cert_file)
     self.key_file = key_file
     self.cert_file = cert_file
     self.ca_file = ca_file
     self.timeout = timeout
     self.path = path
     self.port = port
    def __init__(self, protocol=None, host=None, username=None, password=None):

        self.protocol = protocol
        if self.protocol == "https":
            self.default_port = 443
        else:
            self.default_port = 80

        self.username = username
        self.password = password
        self.auth = None
        self.basic_auth_header = None
        self.nc = 0
        self.qop = None
        self.nonce = None
        self.opaque = None
        self.algorithm = None
        self.last_nonce = None
        HTTPSConnection.__init__(self, host=host)
Beispiel #12
0
 def __init__(self, *args, **kwargs):
     HTTPSConnection.__init__(self, *args, **kwargs)
Beispiel #13
0
 def __init__(self, host, port=None, strict=None):
     HTTPSConnection.__init__(self, host, port) 
     self.request_length = 0
Beispiel #14
0
 def __init__(self, path, *args, **kwargs):
     HTTPSConnection.__init__(self, *args, **kwargs)
     self.path = path
Beispiel #15
0
 def __init__(self, host, ca_file=None):
     HTTPSConnection.__init__(self, host)
     self.__ca_file = ca_file
Beispiel #16
0
 def __init__(self, host, **kwargs):
     HTTPSConnection.__init__(self, host, **kwargs)
Beispiel #17
0
 def __init__(self, path, *args, **kwargs):
     HTTPSConnection.__init__(self, *args, **kwargs)
     self.path = path
Beispiel #18
0
 def __init__(self, host, port=None, timeout=20, **kwargs):
     HTTPSConnection.__init__(self, str(host), port, **kwargs)
     self.timeout = timeout
Beispiel #19
0
 def __init__(self, host, port=None, strict=None):
     strict = strict
     HTTPSConnection.__init__(self, host, port, strict)
     self.request_length = 0
 def __init__(self, host, port, ca_certs):
     HTTPSConnection.__init__(self, host, port)
     self.ca_certs = ca_certs
 def __init__(self, proxytype, proxyaddr, proxyport=None, rdns=True, username=None, password=None, *args, **kwargs):
     self.proxyargs = (proxytype, proxyaddr, proxyport, rdns, username, password)
     HTTPSConnection.__init__(self, *args, **kwargs)
 def __init__(self, *a, **k):
     k['context'] = ssl._create_unverified_context()
     HTTPSConnection.__init__(self, *a, **k)
Beispiel #23
0
 def __init__(self, *a, **k):
     k['context'] = ssl._create_unverified_context()
     HTTPSConnection.__init__(self, *a, **k)
Beispiel #24
0
 def __init__(self, host, port=None, timeout=20, **kwargs):
     HTTPSConnection.__init__(self, str(host), port, **kwargs)
     self.timeout = timeout
 def __init__(self, host, port, ca_certs):
     HTTPSConnection.__init__(self, host, port)
     self.ca_certs = ca_certs
Beispiel #26
0
 def __init__(self, host, port=None, strict=None):
     ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
     HTTPSConnection.__init__(self, host, port, context=ctx)
     self.request_length = 0
Beispiel #27
0
 def __init__(self, host, port=None, strict=None):
     if sys.version < "3.4":
         HTTPSConnection.__init__(self, host, port, strict=strict)
     else:
         HTTPConnection.__init__(self, host, port)
     self.request_length = 0
Beispiel #28
0
 def __init__(self, host, port=None):
     HTTPSConnection.__init__(self, host, port)
     self.request_length = 0
Beispiel #29
0
 def __init__(self, host, port, timeout):
     HTTPSConnection.__init__(self, host, port)
     self.timeout = timeout