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