Module Pssl

Imported modules

Class PsslProxy

A plug proxy which implements SSL on either sides.

Attributes:

Table 4-88. Untitled

stack_proxy the proxy to stack into Pssl
copy_to_clientCopy data in server->client direction
copy_to_serverCopy data in client->server direction
bandwidth_to_clientReadonly variable containing the utilized bandwidth in server->client direction.
bandwidth_to_serverReadonly variable containing the utilized bandwidth in client->server direction.
packet_stats_intervalThe number of milliseconds between two successive packetStats() events. By default: 0. NOTE: this is currently implemented as the number of passing packages, not as milliseconds.
client_need_sslUse SSL on the client side of the proxy. This requires setting client_key and client_cert
client_key Client side authentication private key
client_cert Client side authentication certificate
server_need_sslUse SSL on the server side of the proxy. Optionally you can set the server_key and server_cert attributes if you want to perform authentication.
server_key Server side authentication private key
server_cert Server side authentication certificate
CADirecory Directory containing acceptable CA-s in PEM format.
CRLDirectory Direcory containint Certificate Revokation Lists.
verify_type Type of client (or server) verify. It's may be SSL_VERIFY_NONE, for no verification, SSL_VERIFY_OPTIONAL, for optional verification, SSL_VERIFY_REQUIRED, if Certificate is required, but may not signed with any CA, and SSL_VERIFY_REQUIRED_WITH_CA, if client (or server) must have a valid certificate signed with valid CA.
verify_depthHow deep a CA accepted.

Constructor __init__

Initializes a PsslProxy instance.

Synopsis

__init__ ( self,  session )

Description

Sets attributes based on arguments.

Arguments

Table 4-89. Arguments for PsslProxy.__init__()

self this instance
sessionthe reference of the owning session

Method requestStack

Query whether to stack anything to Pssl.

Synopsis

requestStack ( self )

Description

Callback called by the underlying C proxy to query if something is to be stacked.

Arguments

Table 4-90. Arguments for PsslProxy.requestStack()

selfthis instance

Method stackProxy

Actually do the stacking.

Synopsis

stackProxy (
        self,
        client_fd,
        server_fd,
        )

Description

Callback called by the underlying C proxy to actually stack in something.

Arguments

Table 4-91. Arguments for PsslProxy.stackProxy()

selfthis instance
client_fdupstream client side fd
server_fdupstream server side fd