Helper function used by `run`.

def get_server_setting(self, protocol, host='127.0.0.1', port=8000,
                           debug=False, ssl=None, sock=None, workers=1,
                           loop=None, backlog=100, has_log=True):
        '''Helper function used by `run`.'''

        if isinstance(ssl, dict):
            # try common aliaseses
            cert = ssl.get('cert') or ssl.get('certificate')
            key = ssl.get('key') or ssl.get('keyfile')
            if cert is None or key is None:
                raise ValueError('SSLContext or certificate and key required.')
            context = create_default_context(purpose=Purpose.CLIENT_AUTH)
            context.load_cert_chain(cert, keyfile=key)
            ssl = context

        server_settings = {
            'protocol': protocol,
            'request_handler': self.request_handler,
            'log': self.log,
            'netlog': self.netlog,
            'host': host,
            'port': port,
            'sock': sock,
            'ssl': ssl,
            'signal': self.signal,
            'debug': debug,
            'request_timeout': self.request_timeout,
            'request_max_size': self.request_max_size,
            'keep_alive': self.keep_alive,
            'loop': loop,
            'backlog': backlog,
            'has_log': has_log
        }
        for event_name, settings_name, reverse in (
                ('before_server_start', 'before_start', False),
                ('after_server_start', 'after_start', False),
                ('before_server_stop', 'before_stop', True),
                ('after_server_stop', 'after_stop', True),
        ):
            listeners = self.listeners[event_name].copy()
            if reverse:
                listeners.reverse()
            # Prepend mach9 to the arguments when listeners are triggered
            listeners = [partial(listener, self.app) for listener in listeners]
            server_settings[settings_name] = listeners

        if debug:
            self.log.setLevel(logging.DEBUG)

        # Serve
        if host and port:
            proto = 'http'
            if ssl is not None:
                proto = 'https'
            self.log.info('Goin\' Fast @ {}://{}:{}'.format(proto, host, port))
        return server_settings