__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.
|