def get_environ(self): env = SocketIOHandler.get_environ(self) env['SSL'] = isinstance(self.socket, SSLSocket) env['SSL_CLIENT_VALID'] = False env['SSL_CLIENT_USER'] = None if env['SSL']: certificate = self.socket.get_peer_certificate() env['SSL_CLIENT_CERTIFICATE'] = certificate if certificate: user = ClientCertificateVerificator.get(wu.context).verify(certificate) env['SSL_CLIENT_VALID'] = bool(user) env['SSL_CLIENT_USER'] = user env['SSL_CLIENT_DIGEST'] = certificate.digest('sha1') return env
def get_environ(self): env = SocketIOHandler.get_environ(self) env['SSL'] = isinstance(self.socket, SSLSocket) env['SSL_CLIENT_VALID'] = False env['SSL_CLIENT_USER'] = None if env['SSL']: certificate = self.socket.get_peer_certificate() env['SSL_CLIENT_CERTIFICATE'] = certificate if certificate: user = ClientCertificateVerificator.get(aj.context).verify(certificate) env['SSL_CLIENT_VALID'] = bool(user) env['SSL_CLIENT_USER'] = user env['SSL_CLIENT_DIGEST'] = certificate.digest('sha1') return env
def get_environ(self): env = SocketIOHandler.get_environ(self) env['SSL'] = isinstance(self.socket, gevent.ssl.SSLSocket) env['SSL_CLIENT_VALID'] = False env['SSL_CLIENT_USER'] = None if env['SSL']: peer_cert = self.socket.getpeercert(True) if peer_cert: certificate = crypto.load_certificate(crypto.FILETYPE_PEM, gevent.ssl.DER_cert_to_PEM_cert(peer_cert)) env['SSL_CLIENT_CERTIFICATE'] = certificate if certificate: user = ClientCertificateVerificator.get(aj.context).verify(certificate) env['SSL_CLIENT_VALID'] = bool(user) env['SSL_CLIENT_USER'] = user env['SSL_CLIENT_DIGEST'] = certificate.digest('sha1') return env
def handle_one_response(self): prefix = self.environ.get('HTTP_X_URL_PREFIX', '') self.server.resource = (prefix + '/socket.io').strip('/') response = SocketIOHandler.handle_one_response(self) self.server.resource = 'socket.io' return response
def __init__(self, *args, **kwargs): SocketIOHandler.__init__(self, *args, **kwargs) self.server.resource = 'socket.io'
def _sendall(self, data): data = six.binary_type(data) if data else data return SocketIOHandler._sendall(self, data)
def _sendall(self, data): if isinstance(data, six.text_type): data = six.binary_type(data.encode('utf-8')) return SocketIOHandler._sendall(self, data)
def __init__(self, config, sock, address, server, rfile=None): if server.socket_type == socket.AF_UNIX: address = ['0.0.0.0'] SocketIOHandler.__init__(self, config, sock, address, server, rfile)
def _sendall(self, data): if isinstance(data, six.text_type): data = six.binary_type(data) return SocketIOHandler._sendall(self, data)
def handle_one_response(self): if not _validate_origin(self.environ): return super(SocketIOHandler, self).handle_one_response() return SocketIOHandler.handle_one_response(self)
def _sendall(self, data): if isinstance(data, str): data = data.encode('utf-8') return SocketIOHandler._sendall(self, data)
def _sendall(self, data): data = str(data) if data else data return SocketIOHandler._sendall(self, data)