a
    kÄ#d
  ã                   @   sT  d Z ddlZddlZej ej ej e¡d¡¡Zegej e_ddl	m
Z
 ddlmZ ddlmZ edd�Zejd	d
d� ejdddd� ejddd� ejdddd� ejdddd� ejdddd� ejdddd� ejdddddd � e ¡ ZdZej�rej�rd!Znd"Zeed# ed$ eejejejejejejeejd%�Ze ¡  dS )&a$  
Basic TLS server. A preferred ciphersuite may be provided as first argument.

For instance, "sudo ./server_simple.py c014" will start a server accepting
any TLS client connection. If provided, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
will be preferred to any other suite the client might propose.
é    Nz../../)Úconf)ÚTLSServerAutomaton)ÚArgumentParserzSimple TLS Server)Údescriptionz--pskz7External PSK for symmetric authentication (for TLS 1.3))Úhelpz--no_pfsÚ
store_truez!Disable (EC)DHE exchange with PFS)Úactionr   z--curvez(ECC curve to advertise (ex: secp256r1...z--cookiez2Send cookie extension in HelloRetryRequest messagez--client_authzRequire client authenticationz--handle_session_ticketz@Use session tickets. Auto enabled if file provided (for TLS 1.3)z--ticket_fileÚsession_ticket_filez,File to write/read a ticket to (for TLS 1.3))Údestr   z--debugÚstore_consté   zEnter debug mode)r   ÚconstÚdefaultr   Zpsk_keZ
psk_dhe_kez/test/tls/pki/srv_cert.pemz/test/tls/pki/srv_key.pem)ZmycertZmykeyZpreferred_ciphersuiteÚclient_authÚcurveÚcookieÚhandle_session_ticketr	   ÚpskÚpsk_modeÚdebug)Ú__doc__ÚosÚsysÚpathÚabspathÚjoinÚdirnameÚ__file__ZbasedirZscapy.configr   Zscapy.layers.tls.automaton_srvr   Úargparser   ÚparserÚadd_argumentÚ
parse_argsÚargsZpcsZno_pfsr   r   r   r   r   r   r	   r   ÚtÚrun© r%   r%   úN/var/www/html/gsl.tools/lib/python3.9/site-packages/test/tls/example_server.pyÚ<module>   s`   
ÿÿÿÿÿÿÿö