Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : fdshops ( 1003)
PHP Version : 8.2.21
Disable Function : NONE
Directory :  /lib/python2.7/site-packages/certbot/_internal/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyo
�
���_c@s�dZddlZddlZddlZddlmZddlZddlZddlZ	ddl
mZddl
mZ
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZeje�Zer@ee
jeejfZnde fd��YZ!e	j"j#ej$�e	j"j%ej&�dej'fd��Y��Z(d�Z)dS(sStandalone Authenticator.i����N(terrno(t
challenges(t
standalone(tDefaultDict(tDict(tSet(tTuple(t
TYPE_CHECKING(tachallenges(terrors(t
interfaces(tcommont
ServerManagercBs5eZdZd�Zdd�Zd�Zd�ZRS(s�Standalone servers manager.

    Manager for `ACMEServer` and `ACMETLSServer` instances.

    `certs` and `http_01_resources` correspond to
    `acme.crypto_util.SSLSocket.certs` and
    `acme.crypto_util.SSLSocket.http_01_resources` respectively. All
    created servers share the same certificates and resources, so if
    you're running both TLS and non-TLS instances, HTTP01 handlers
    will serve the same URLs!

    cCsi|_||_||_dS(N(t
_instancestcertsthttp_01_resources(tselfRR((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyt__init__-s		tcCs�||jkr|j|S||f}ytj||j�}Wn(tjk
ri}tj||��nX|j�|j	�dd}||j|<|S(sRun ACME server on specified ``port``.

        This method is idempotent, i.e. all calls with the same pair of
        ``(port, challenge_type)`` will reuse the same server.

        :param int port: Port to run the server on.
        :param challenge_type: Subclass of `acme.challenges.Challenge`,
            currently only `acme.challenge.HTTP01`.
        :param str listenaddr: (optional) The address to listen on. Defaults to all addrs.

        :returns: DualNetworkedServers instance.
        :rtype: ACMEServerMixin

        ii(
R
tacme_standalonetHTTP01DualNetworkedServersRtsocketterrorR	tStandaloneBindErrort
serve_forevertgetsocknames(Rtporttchallenge_typet
listenaddrtaddresstserversRt	real_port((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pytrun2s

cCsP|j|}x(|j�D]}tjd|d �qW|j�|j|=dS(sWStop ACME server running on the specified ``port``.

        :param int port:

        sStopping server at %s:%d...iN(R
Rtloggertdebugtshutdown_and_server_close(RRtinstancetsockname((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pytstopTs
	
cCs
|jj�S(s�Return all running instances.

        Once the server is stopped using `stop`, it will not be
        returned.

        :returns: Mapping from ``port`` to ``servers``.
        :rtype: tuple

        (R
tcopy(R((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pytrunningas
(t__name__t
__module__t__doc__RR R&R((((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyR s
	"	
t
AuthenticatorcBsteZdZdZd�Zed��Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�ZRS(sStandalone Authenticator.

    This authenticator creates its own ephemeral TCP listener on the
    necessary port in order to respond to incoming http-01
    challenges from the certificate authority. Therefore, it does not
    rely on any existing server program.
    sSpin up a temporary webservercOs\tt|�j||�tjt�|_i|_t�|_t	|j|j�|_
dS(N(tsuperR,RtcollectionstdefaultdicttsettservedRRRR(Rtargstkwargs((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyR{s
	cCsdS(N((tclstadd((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pytadd_parser_arguments�scCsdS(Ns�This authenticator creates its own ephemeral TCP listener on the necessary port in order to respond to incoming http-01 challenges from the certificate authority. Therefore, it does not rely on any existing server program.((R((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyt	more_info�scCsdS(N((R((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pytprepare�scCs
tjgS(N(RtHTTP01(Rtdomain((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pytget_chall_pref�scCs g|D]}|j|�^qS(N(t_try_perform_single(Rtachallstachall((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pytperform�scCsEx>tr@y|j|�SWqtjk
r<}t|�qXqWdS(N(tTruet_perform_singleR	Rt_handle_perform_error(RR>R((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyR<�s
	cCs-|j|�\}}|j|j|�|S(N(t_perform_http_01R1R5(RR>Rtresponse((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyRA�scCs�|jj}|jj}|jj|tjd|�}|j�\}}tj	j
d|jd|d|�}|jj
|�||fS(NRtchallRDt
validation(tconfigthttp01_portthttp01_addressRR RR9tresponse_and_validationRtHTTP01RequestHandlertHTTP01ResourceRERR5(RR>RtaddrRRDRFtresource((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyRC�scCs�xJ|jj�D]9\}}x*|D]"}||kr#|j|�q#q#WqWxFtj|jj��D],\}}|j|sf|jj|�qfqfWdS(N(R1titemstremovetsixt	iteritemsRR(R&(RR=tunused_serverstserver_achallsR>RR((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pytcleanup�s
%
(R)R*R+tdescriptionRtclassmethodR6R7R8R;R?R<RARCRU(((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyR,ns									
cCs�|jjtjkr3tjdj|j���n|jjtjkr�t	j
jtj
�}dj|j�}|j|dddt�}|s�tj|��q�n|�dS(Ns�Could not bind TCP port {0} because you don't have the appropriate permissions (for example, you aren't running this program as root).s�Could not bind TCP port {0} because it is already in use by another process on this system (such as a web server). Please stop the program in question and then try again.tRetrytCanceltdefault(tsocket_errorRt
socket_errorstEACCESR	tPluginErrortformatRt
EADDRINUSEtzopet	componentt
getUtilityR
tIDisplaytyesnotFalse(Rtdisplaytmsgtshould_retry((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyRB�s(*R+R.tloggingRRR\tOpenSSLRQtzope.interfaceRatacmeRRRtacme.magic_typingRRRRRtcertbotRR	R
tcertbot.pluginsRt	getLoggerR)R!tBaseDualNetworkedServerst"KeyAuthorizationAnnotatedChallenget
ServedTypetobjectRt	interfacetimplementertIAuthenticatortprovidertIPluginFactorytPluginR,RB(((sH/usr/lib/python2.7/site-packages/certbot/_internal/plugins/standalone.pyt<module>s8NO

Spamworldpro Mini