nbxmpp.tls_nb.NonBlockingTLS

Package nbxmpp :: Module tls_nb :: Class NonBlockingTLS |
[hide private]
[frames] | no frames]

# Class NonBlockingTLS

source code

TLS connection used to encrypts already estabilished tcp connection

Can be plugged into NonBlockingTCP and will make use of StdlibSSLWrapper or PyOpenSSLWrapper.

Instance Methods | [hide private]
__init__(self, cacerts, mycerts) | source code
plugin(self, owner) Use to PlugIn TLS into transport and start establishing immediately. Returns True if TLS/SSL was established correctly, otherwise False | source code
_dumpX509(self, cert, stream=sys.stderr) | source code
_dumpX509Name(self, name, stream=sys.stderr) | source code
_dumpPKey(self, pkey, stream=sys.stderr) | source code
_startSSL(self) Immediatedly switch socket to TLS mode. Used internally | source code
_load_cert_file(self, cert_path, cert_store, logg=True) | source code
_startSSL_pyOpenSSL(self) | source code
_startSSL_stdlib(self) | source code
_ssl_verify_callback(self, sslconn, cert, errnum, depth, ok) | source code
Inherited from `plugin.PlugIn`: `PlugIn`, `PlugOut`

Class Methods | [hide private]
Inherited from `plugin.PlugIn`: `get_instance`

Class Variables | [hide private]
| ssl_h_bits = ``{``'``SSL_CB_ALERT``'``:` 16384`,` `'``SSL_CB_EXIT``'``:` 2`,` `'``SSL_CB``...``

Method Details | [hide private]

### __init__(self, cacerts, mycerts) (Constructor) | source code
Parameters: `cacerts` - path to pem file with certificates of known XMPP servers `mycerts` - path to pem file with certificates of user trusted servers Overrides: plugin.PlugIn.__init__

### plugin(self, owner) | source code
Use to PlugIn TLS into transport and start establishing immediately. Returns True if TLS/SSL was established correctly, otherwise False

### _dumpX509(self, cert, stream=sys.stderr) | source code

### _dumpX509Name(self, name, stream=sys.stderr) | source code

### _dumpPKey(self, pkey, stream=sys.stderr) | source code

### _startSSL(self) | source code
Immediatedly switch socket to TLS mode. Used internally

### _load_cert_file(self, cert_path, cert_store, logg=True) | source code

### _startSSL_pyOpenSSL(self) | source code

### _startSSL_stdlib(self) | source code

### _ssl_verify_callback(self, sslconn, cert, errnum, depth, ok) | source code

Class Variable Details | [hide private]

  ### ssl_h_bits Value:
      {'SSL_CB_ALERT': 16384,
       'SSL_CB_EXIT': 2,
       'SSL_CB_HANDSHAKE_DONE': 32,
       'SSL_CB_HANDSHAKE_START': 16,
       'SSL_CB_LOOP': 1,
       'SSL_CB_READ': 4,
       'SSL_CB_WRITE': 8,
       'SSL_ST_ACCEPT': 8192,
      ...