Package httxlib :: Module httxs :: Class HTTPSxConnection
[hide private]
[frames] | no frames]

Class HTTPSxConnection

source code

httplib.HTTPConnection --+    
                         |    
   httplib.HTTPSConnection --+
                             |
                            HTTPSxConnection
Known Subclasses:

Reimplementation of HTTPSConnection but sublcassing from HTTPSConnection to allow certificate validation if wished

HTTPxConnection omitted this possibilitiy which is supported by the Python ssl library and the wrap_socket functionality

HTTPxConnection is subclassed, receives two new member variables and overrides connect to better call ssl.wrap_socket

Please read the Python 2.6 documentation on SSL and certificate validation

Nested Classes [hide private]

Inherited from httplib.HTTPConnection: response_class

Instance Methods [hide private]
 
__init__(self, host, port=None, key_file=None, cert_file=None, strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT)
Constructor.
source code
 
connect(self)
Opens the connection and wraps it in a ssl socket
source code
 
sslwrap(self)
Wraps the connection into a ssl socket
source code

Inherited from httplib.HTTPConnection: close, endheaders, getresponse, putheader, putrequest, request, send, set_debuglevel, set_tunnel

Inherited from httplib.HTTPConnection (private): _output, _send_output, _send_request, _set_content_length, _set_hostport, _tunnel

Class Variables [hide private]

Inherited from httplib.HTTPSConnection: default_port

Inherited from httplib.HTTPConnection: auto_open, debuglevel, strict

Inherited from httplib.HTTPConnection (private): _http_vsn, _http_vsn_str

Instance Variables [hide private]
str ca_certs
Path to the file containing the root (chain of) certificate(s)
enumeration cert_reqs
It dictates if certificate validation will be done.
Method Details [hide private]

__init__(self, host, port=None, key_file=None, cert_file=None, strict=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT)
(Constructor)

source code 

Constructor. It delegates construction to the base class HTTPConnection and initializes the new member variables with the default values from the Python documentation

Parameters:
  • host (str) - host to connect to
  • port (int|None) - port to connect to. use None for the default HTTP port
  • key_file (str|None) - path to private key_file or None if stored in cert_file
  • cert_file (str|None) - path to certificate to be used for validation or None
  • strict (Unknown) - n/a
  • timeout (float) - default time for network operations
Overrides: httplib.HTTPConnection.__init__

connect(self)

source code 

Opens the connection and wraps it in a ssl socket

Overrriding is needed to enable certificate validation

Overrides: httplib.HTTPConnection.connect

Instance Variable Details [hide private]

cert_reqs

It dictates if certificate validation will be done. It uses the ssl: CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED values from the ssl module
Type:
enumeration