Package httxlib :: Module httxcertificates :: Class HttxCertReqManager
[hide private]
[frames] | no frames]

Class HttxCertReqManager

source code

                 object --+        
                          |        
      httxobject.HttxObject --+    
                              |    
httxpassmanager.HttxPassManager --+
                                  |
                                 HttxCertReqManager

A subclass of HttxPassManager to hold the requirement for server certificate validation in https connections.

It stores the requirement on a per url basis by transforming the enumeration value into a string on storage and undoing the operation on retrieval

A catch_all empty string can be used to validate against any url

Instance Methods [hide private]
 
__init__(self)
Constructor.
source code
 
add_cert_req(self, url, cert_req)
Add validation requirement for the given url
source code
int
find_cert_req(self, url)
Retrieve validation requirement for the given url
source code

Inherited from httxpassmanager.HttxPassManager: __deepcopy__, add_password, find_user_password

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  certReqs = {0: 'CERT_NONE', 1: 'CERT_OPTIONAL', 2: 'CERT_REQUI...
mapping of enumeration to string for storage
  certReqsInv = {'CERT_NONE': 0, 'CERT_OPTIONAL': 1, 'CERT_REQUI...
inverse mapping of enumeration to string for storage

Inherited from httxpassmanager.HttxPassManager: passmanager

Inherited from httxobject.HttxObject: lock

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor. It delegates construction to the base class HttxPassManager

Overrides: object.__init__

add_cert_req(self, url, cert_req)

source code 

Add validation requirement for the given url

Parameters:
  • url (str) - url to be matched for certificate/private key files
  • cert_req (str) - validation requirement from SSL CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED

find_cert_req(self, url)

source code 

Retrieve validation requirement for the given url

Parameters:
  • url (str) - url to be matched for certificate/private key files
Returns: int
the validation requirement

Instance Variable Details [hide private]

certReqs

mapping of enumeration to string for storage
Value:
{0: 'CERT_NONE', 1: 'CERT_OPTIONAL', 2: 'CERT_REQUIRED'}

certReqsInv

inverse mapping of enumeration to string for storage
Value:
{'CERT_NONE': 0, 'CERT_OPTIONAL': 1, 'CERT_REQUIRED': 2}