def 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.""" c=m2.ssl_get_current_cipher(self.ssl) if c is None: return None return Cipher(c)
def 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.""" c = m2.ssl_get_current_cipher(self.ssl) if c is None: return None return Cipher(c)
def readRequest(self, request): if request.isSecure(): # PyOpenSSL (HTTPS) connection self.is_encrypted = True self.transport = u"HTTPS" return transport = request.channel.transport if isinstance(transport, TLSProtocolWrapper): # M2Crypto (HTTPS) connection self.is_encrypted = True ssl = transport.ssl.ssl proto = ssl_get_version(ssl) cipher = ssl_get_current_cipher(ssl) if cipher is not None: cipher = str(Cipher(cipher)) else: cipher = 'HTTPS' self.transport = u"%s:%s" % (proto, str(cipher)) else: # Clear text (HTTP) connection self.is_encrypted = False self.transport = u"HTTP"