HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/lib64/python2.7/site-packages/M2Crypto/SSL/SSLServer.py
"""SSLServer

Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved."""

__all__ = ['SSLServer', 'ForkingSSLServer', 'ThreadingSSLServer']

# Python
import socket, SocketServer

# M2Crypto
from Connection import Connection
from M2Crypto.SSL import SSLError
from M2Crypto import m2


class SSLServer(SocketServer.TCPServer):
    def __init__(self, server_address, RequestHandlerClass, ssl_context, bind_and_activate=True):
        """ 
        Superclass says: Constructor. May be extended, do not override.
        This class says: Ho-hum.
        """
        SocketServer.BaseServer.__init__(self, server_address, RequestHandlerClass)
        self.ssl_ctx=ssl_context
        self.socket=Connection(self.ssl_ctx)
        if bind_and_activate:
            self.server_bind()
            self.server_activate()        

    def handle_request(self):
        request = None
        client_address = None
        try:
            request, client_address = self.get_request()
            if self.verify_request(request, client_address):
                self.process_request(request, client_address)
        except SSLError:
            self.handle_error(request, client_address)

    def handle_error(self, request, client_address):
        print '-'*40
        import traceback
        traceback.print_exc()
        print '-'*40


class ForkingSSLServer(SocketServer.ForkingMixIn, SSLServer):
    pass


class ThreadingSSLServer(SocketServer.ThreadingMixIn, SSLServer):
    pass