pyxmpp.streamtls.TLSSettings

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 two arguments: 'ok' and 'store_context' and return True if a certificate is accepted. The verification callback should call Stream.tls_is_certificate_valid() to check if certificate subject name matches stream peer JID. See M2Crypto documentation for details. If no verify_callback is provided, then default `Stream.tls_default_verify_callback` will be used.

Instance Variable Details | [hide private]

### verify_callback callback function for certificate verification. See M2Crypto documentation for details.