Package M2Crypto :: Package SSL :: Module Connection' :: Class Connection
[frames] | no frames]

Class Connection



An SSL connection.

Instance Methods
 
__del__(self)
 
__init__(self, ctx, sock=None)
 
accept(self)
Accept an SSL connection.
 
accept_ssl(self)
 
bind(self, addr)
 
clear(self)
If there were errors in this connection, call clear() rather than close() to end it, so that bad sessions will be cleared from cache.
 
close(self)
 
connect(self, addr)
 
connect_ssl(self)
 
fileno(self)
 
get_cipher(self)
Return an M2Crypto.SSL.Cipher object for this connection; if the connection has not been initialised with a cipher suite, return None.
 
get_cipher_list(self, idx=0)
Return the cipher suites for this connection as a string object.
 
get_ciphers(self)
Return an M2Crypto.SSL.Cipher_Stack object for this connection; if the connection has not been initialised with cipher suites, return None.
 
get_context(self)
Return the SSL.Context object associated with this connection.
 
get_default_session_timeout(self)
 
get_peer_cert(self)
Return the peer certificate; if the peer did not provide a certificate, return None.
 
get_peer_cert_chain(self)
Return the peer certificate chain; if the peer did not provide a certificate chain, return None.
 
get_session(self)
 
get_shutdown(self)
 
get_socket_read_timeout(self)
 
get_socket_write_timeout(self)
 
get_state(self)
Return the SSL state of this connection.
 
get_verify_depth(self)
Return the peer certificate verification depth.
 
get_verify_mode(self)
Return the peer certificate verification mode.
 
get_verify_result(self)
Return the peer certificate verification result.
 
get_version(self)
Return the TLS/SSL protocol version for this connection.
 
getpeername(self)
 
getsockname(self)
 
getsockopt(self, *args)
 
listen(self, qlen=5)
 
m2_bio_free(...)
 
m2_ssl_free(...)
 
makefile(self, mode='rb', bufsize='ignored')
 
pending(self)
Return the numbers of octets that can be read from the connection.
 
read(self, size=1024)
 
recv(self, size=1024)
 
renegotiate(self)
Renegotiate this connection's SSL parameters.
 
send(self, data)
 
sendall(self, data)
 
serverPostConnectionCheck(*args, **kw)
 
set_accept_state(self)
 
set_bio(self, readbio, writebio)
Explicitly set read and write bios
 
set_cipher_list(self, cipher_list)
Set the cipher suites for this connection.
 
set_client_CA_list_from_context(self)
Set the acceptable client CA list.
 
set_client_CA_list_from_file(self, cafile)
Set the acceptable client CA list.
 
set_connect_state(self)
 
set_post_connection_check_callback(self, postConnectionCheck)
 
set_session(self, session)
 
set_session_id_ctx(self, id)
 
set_shutdown(self, mode)
 
set_socket_read_timeout(self, timeo)
 
set_socket_write_timeout(self, timeo)
 
set_ssl_close_flag(self, flag)
By default, SSL struct will be freed in __del__.
 
setblocking(self, mode)
Set this connection's underlying socket to _mode_.
 
setsockopt(self, *args)
 
setup_addr(self, addr)
 
setup_ssl(self)
 
shutdown(self, how)
 
ssl_get_error(self, ret)
 
verify_ok(self)
 
write(self, data)
Class Variables
  clientPostConnectionCheck = <M2Crypto.SSL.Checker.Checker inst...
Method Details

accept(self)

 

Accept an SSL connection. The return value is a pair (ssl, addr) where ssl is a new SSL connection object and addr is the address bound to the other end of the SSL connection.

set_client_CA_list_from_context(self)

 

Set the acceptable client CA list. If the client returns a certificate, it must have been issued by one of the CAs listed in context.

Makes sense only for servers.

set_client_CA_list_from_file(self, cafile)

 

Set the acceptable client CA list. If the client returns a certificate, it must have been issued by one of the CAs listed in cafile.

Makes sense only for servers.

Parameters:
  • cafile - Filename from which to load the CA list.

set_ssl_close_flag(self, flag)

 

By default, SSL struct will be freed in __del__. Call with m2.bio_close to override this default.


Class Variable Details

clientPostConnectionCheck

Value:
<M2Crypto.SSL.Checker.Checker instance at 0x842ad0c>