Server IP : 208.109.241.143 / Your IP : 3.147.61.168 Web Server : Apache System : Linux 143.241.109.208.host.secureserver.net 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64 User : internationaljou ( 1003) PHP Version : 8.1.30 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/var/opt/nydus/ops/primordial/wsgi/__pycache__/ |
Upload File : |
U :�g � @ s� d dl mZmZ d dlZd dlZd dlmZ eeedd�dd�Zeeedd�dd�Z deee ee ee dd �d d�Z dd � ZdS )� )�Callable�OptionalN)�Config)�config�api�path�returnc C s t j�||� t| � dS )z�Start CherryPy running an API. :param config: The configuration to use for CherryPy :param api: The API callable to be started :param path: The path under which the API should respond to requests N)�cherrypy�tree�graft�run_cherrypy)r r r � r �L/opt/nydus/tmp/pip-target-d6ig7x5r/lib/python/primordial/wsgi/cherrytools.py�start_cherry s r c C s@ t j�||� | �d�}| �d�}| �d�}t| |||d� dS )a* Start CherryPy running an API on HTTPS only. This is a backport of how ServiceGroup & DNS verticals start. :param config: The configuration to use for CherryPy :param api: The API callable to be started :param path: The path under which the API should respond to requests Zserver_certZ server_keyZ server_ca)� cert_path�key_path� ca_certs_pathN)r r r �getr )r r r � cert_fileZ pkey_fileZ ca_certs_filer r r �start_cherry_https s �r )r r r r r c C s� | � d�}tjjj�|� |tjj_| � d�}| �d�}|rh|dk rhtj� ||d||t |||�d�� n| �d�}tj� ||d�� tj�� tj�� dS ) znRun CherryPy. Called by `start_cherry`. :param config: The configuration to use for running CherryPy �restart_triggerzserver.hostzserver.https.portN�builtin)�server.socket_host�server.socket_portzserver.ssl_modulezserver.ssl_certificatezserver.ssl_private_keyzserver.ssl_contextzserver.port)r r ) r r ZengineZ autoreload�files�add�matchZget_intr �update�ssl_context�start�block)r r r r r Zserver_hostZ https_portZserver_portr r r r - s( � � r c C s* t jt jj|d�}|�| |� t j|_|S )a4 Create a server SSL context requiring client certificate authentication. :param certificate: Path to server certificate. :param private_key: Path to server private key. :param ca_certs: Path to certificate authority chain against which client certificates are validated. )�purpose�cafile)�ssl�create_default_context�Purpose�CLIENT_AUTH�load_cert_chain� CERT_REQUIRED�verify_mode)ZcertificateZprivate_key�ca_certs�contextr r r r P s �r )NNN)�typingr r r# r Zprimordial.configr �strr r r r r r r r �<module> s � �#