Example #1
0
 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"
Example #2
0
 def get_version(self):
     # type: () -> str
     """Return the TLS/SSL protocol version for this connection."""
     return m2.ssl_get_version(self.ssl)
Example #3
0
 def get_version(self):
     "Return the TLS/SSL protocol version for this connection."
     return m2.ssl_get_version(self.ssl)
Example #4
0
 def get_version(self):
     "Return the TLS/SSL protocol version for this connection."
     return m2.ssl_get_version(self.ssl)
Example #5
0
 def get_version(self):
     # type: () -> str
     """Return the TLS/SSL protocol version for this connection."""
     return six.ensure_text(m2.ssl_get_version(self.ssl))
Example #6
0
 def get_version(self):
     # type: () -> str
     "Return the TLS/SSL protocol version for this connection."
     return util.py3str(m2.ssl_get_version(self.ssl))