Package ganeti :: Package rapi :: Module client :: Class CertAuthorityVerify
[hide private]
[frames] | no frames]

Class CertAuthorityVerify

source code

Certificate verificator for SSL context.

Configures SSL context to verify server's certificate.

Instance Methods [hide private]
 
__init__(self, cafile=None, capath=None, use_default_verify_paths=False)
Initializes this class.
source code
 
__call__(self, ctx, logger)
Configures an SSL context to verify certificates.
source code
Static Methods [hide private]
 
_VerifySslCertCb(logger, _, cert, errnum, errdepth, ok)
Callback for SSL certificate verification.
source code
Class Variables [hide private]
  _CAPATH_MINVERSION = "0.9"
  _DEFVFYPATHS_MINVERSION = "0.9"
  _PYOPENSSL_VERSION = OpenSSL.__version__
  _PARSED_PYOPENSSL_VERSION = distutils.version.LooseVersion(_PY...
  _SUPPORT_CAPATH = _PARSED_PYOPENSSL_VERSION >= _CAPATH_MINVERSION
  _SUPPORT_DEFVFYPATHS = _PARSED_PYOPENSSL_VERSION >= _DEFVFYPAT...
Method Details [hide private]

__init__(self, cafile=None, capath=None, use_default_verify_paths=False)
(Constructor)

source code 

Initializes this class.

Parameters:
  • cafile (string) - In which file we can find the certificates
  • capath (string) - In which directory we can find the certificates
  • use_default_verify_paths (bool) - Whether the platform provided CA certificates are to be used for verification purposes

_VerifySslCertCb(logger, _, cert, errnum, errdepth, ok)
Static Method

source code 

Callback for SSL certificate verification.

Parameters:
  • logger - Logging object

__call__(self, ctx, logger)
(Call operator)

source code 

Configures an SSL context to verify certificates.

Parameters:
  • ctx (OpenSSL.SSL.Context) - SSL context

Class Variable Details [hide private]

_PARSED_PYOPENSSL_VERSION

Value:
distutils.version.LooseVersion(_PYOPENSSL_VERSION)

_SUPPORT_DEFVFYPATHS

Value:
_PARSED_PYOPENSSL_VERSION >= _DEFVFYPATHS_MINVERSION