Package pyxmpp :: Module streamtls :: Class TLSSettings
[hide private]

Class TLSSettings

source code

Storage for TLS-related settings of an XMPP stream.
Instance Methods [hide private]
 
__init__(self, require=False, verify_peer=True, cert_file=None, key_file=None, cacert_file=None, verify_callback=None, ctx=None)
Initialize the TLSSettings object.
source code
Instance Variables [hide private]
  cacert_file
: path to a file with trusted CA certificates
  cert_file
: path to own X.509 certificate
  key_file
: path to the private key for own X.509 certificate
  require
: is TLS required
  verify_callback
: callback function for certificate verification.
  verify_peer
: should the peer's certificate be verified
Method Details [hide private]

__init__(self, require=False, verify_peer=True, cert_file=None, key_file=None, cacert_file=None, verify_callback=None, ctx=None)
(Constructor)

source code 
Initialize the TLSSettings object.
Parameters:
  • require - : is TLS required
  • verify_peer - : should the peer's certificate be verified
  • cert_file - : path to own X.509 certificate
  • key_file - : path to the private key for own X.509 certificate
  • cacert_file - : path to a file with trusted CA certificates
  • verify_callback - : callback function for certificate verification. The callback function must accept a single argument: the certificate to verify, as returned by ssl.SSLSocket.getpeercert() and return True if a certificate is accepted. The verification callback should call Stream.tls_is_certificate_valid() to check if certificate subject name or alt subject name matches stream peer JID.