JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/certbot/_internal/__pycache__/client.cpython-39.opt-1.pyc

a

}|�g4��@s2dZddlZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddl
mZddlmZdd
lmZddlmZddlZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z!ddlm"Z"ddl#Z#ddl#m$Z$ddl#mZddl#m Z ddl#m%Z%ddl#m&Z&ddl'm(Z(ddl'm)Z)ddl'm*Z*ddl'm+Z+ddl'm,Z,ddl'm-Z-dd l'm.Z.dd!l/m0Z1dd"l/m2Z3dd#l4m5Z5dd$l6m7Z8ddl6m&Z9dd%l:m;Z;e�<e=�Z>dGe$j?ej@ee"jAejBd&�d'd(�ZCe$j?eDd)�d*d+�ZEe$j?eDd)�d,d-�ZFGd.d/�d/�ZGeDd0�d1d2�ZHdHe$j?e;eeeDgdfee(jIejBfd3�d4d5�ZJejBe$j?eeeDgdfe"jAd6�d7d8�ZKGd9d:�d:�ZLdIe&jMee&jNdd;�d<d=�ZOeDePe$j?e1jQdd>�d?d@�ZRe$j?eDeDee	eDfdA�dBdC�ZSeTe	ddD�dEdF�ZUdS)JzCertbot client API.�N)�Any)�Callable)�cast)�Dict)�IO)�List)�Optional)�Tuple)�x509)�default_backend)�
serialization)�generate_private_key)�ES256)�ES384)�ES512)�RS256)�client)�crypto_util)�errors)�messages)�
configuration)�
interfaces)�util)�account)�auth_handler)�cli)�	constants)�eff)�
error_handler)�storage)�disco)�	selection)�os)�ops)�AccountStorage)�config�key�regr�returncCs�|jdkrL|j}|jdkr t}qP|jdkr0t}qP|jdkr@t}qPt�d��nt}t	j
||||jt|�d�}t	j
�|j|�}t	�
||�S)z Wrangle ACME client constructionZEC�i�i	z6No matching signing algorithm can be found for the key)�algrZ
verify_ssl�
user_agent)�typr&�key_sizerrrrZNotSupportedErrorr�acme_clientZ
ClientNetworkZ
no_verify_ssl�determine_user_agent�ClientV2Z
get_directory�server)r%r&r'�
public_keyr*�net�	directory�r5�</usr/lib/python3.9/site-packages/certbot/_internal/client.py�acme_from_config_key3s$



�
�r7)r%r(cCs�|jdurzd}tj�d�dkr,d}d}d}ntj}t��}t�	�}|�
tj|||j
|j|jt|�||jrrd|jnd	�	}n|j}|S)
z�
    Set a user_agent string in the config based on the choice of plugins.
    (this wasn't knowable at construction time)

    :returns: the client's User-Agent string
    :rtype: `str`
    Nz\CertbotACMEClient/{0} ({1}; {2}{8}) Authenticator/{3} Installer/{4} ({5}; flags: {6}) Py/{7}ZCERTBOT_DOCS�1�certbotzOS_NAME OS_VERSIONzmajor.minor.patchlevelz; �)r+r"�environ�getr�cli_commandrZget_os_info_ua�platform�python_version�formatr9�__version__�
authenticator�	installer�verb�ua_flagsZuser_agent_comment)r%Zuar=Zos_infor?r5r5r6r/Ms 
�r/cs�t�t�rdSg}�jr"|�d��jr2|�d��jrB|�d��jrR|�d�d}�fdd�|D�}t|�rz|�d	�d
�|�S)z@Turn some very important CLI flags into clues in the user agent.�FLAGS�dupZfrnZasn�n)ZpreZpostZrenewZmanual_authZmanual_cleanupcsg|]}t�|d��qS)Z_hook)�getattr)�.0�h�r%r5r6�
<listcomp>{�zua_flags.<locals>.<listcomp>�hook� )	�
isinstance�DummyConfigZ	duplicate�appendZrenew_by_default�allow_subset_of_names�noninteractive_mode�any�join)r%�flagsZ
hook_namesZhooksr5rLr6rEms 





rEc@s.eZdZdZdd�dd�Zeed�dd�ZdS)	rRz'Shim for computing a sample user agent.N�r(cCsd|_d|_d|_d|_dS)NZXXXZYYYZ
SUBCOMMAND)rBrCr+rD)�selfr5r5r6�__init__�szDummyConfig.__init__��namer(cCsdS)z-Any config properties we might have are None.Nr5�rZr]r5r5r6�__getattr__�szDummyConfig.__getattr__)�__name__�
__module__�__qualname__�__doc__r[�strrr_r5r5r5r6rR�srRrYcCstttjt���S)z<Document what this Certbot's user agent string will be like.)r/rr�NamespaceConfigrRr5r5r5r6�sample_user_agent�srf)r%�account_storage�tos_cbr(c	Cs�|��rt�d|j�|jdurN|js>d}t�|�t�|��|j	sNt�
d�|j	rZd|_td|jt
�d�}tjt�|�d�}t||�}t|||�}t�||�}|�||�t�||�||fS)a�Register new account with an ACME CA.

    This function takes care of generating fresh private key,
    registering the account, optionally accepting CA Terms of Service
    and finally saving the account. It should be called prior to
    initialization of `Client`, unless account has already been created.

    :param certbot.configuration.NamespaceConfig config: Client configuration.

    :param .AccountStorage account_storage: Account storage where newly
        registered account will be saved to. Save happens only after TOS
        acceptance step, so any account private keys or
        `.RegistrationResource` will not be persisted if `tos_cb`
        returns ``False``.

    :param tos_cb: If ACME CA requires the user to accept a Terms of
        Service before registering account, client action is
        necessary. For example, a CLI tool would prompt the user
        acceptance. `tos_cb` must be a callable that should accept
        a Term of Service URL as a string, and raise an exception
        if the TOS is not accepted by the client. ``tos_cb`` will be
        called only if the client action is necessary, i.e. when
        ``terms_of_service is not None``. This argument is optional,
        if not supplied it will default to automatic acceptance!

    :raises certbot.errors.Error: In case of any client problems, in
        particular registration failure, or unaccepted Terms of Service.
    :raises acme.errors.Error: In case of any protocol problems.

    :returns: Newly registered and saved account, as well as protocol
        API handle (should be used in `Client` initialization).
    :rtype: `tuple` of `.Account` and `acme.client.Client`

    z*There are already existing accounts for %sNzLNo email was provided and --register-unsafely-without-email was not present.zRegistering without email!i)Zpublic_exponentr-Zbackend)r&)Zfind_all�logger�infor1�emailZregister_unsafely_without_email�errorr�Error�dry_run�debugr
�rsa_key_sizer�joseZJWKRSAZComparableRSAKeyr7�perform_registrationr�Account�saverZprepare_subscription)	r%rgrh�msgZrsa_keyr&�acmer'Zaccr5r5r6�register�s.&



�
rw)rvr%rhr(c	
Cs
|jo
|j}|r8|jj��}tjj||j|j|jd�}nd}|�	�rV|sVd}t
�|��|jjj
}|rp|rp||�z|�tjj|jd|d��WStj�y}z\|jdvr�|jr�d|j�d�}t
�|��tjdd	�|_t|||�WYd}~S�WYd}~n
d}~00dS)
a�
    Actually register new account, trying repeatedly if there are email
    problems

    :param acme.client.Client acme: ACME client object.
    :param certbot.configuration.NamespaceConfig config: Client configuration.
    :param Callable tos_cb: a callback to handle Term of Service agreement.

    :returns: Registration Resource.
    :rtype: `acme.messages.RegistrationResource`
    )�account_public_keyZkidZhmac_keyr4NzRServer requires external account binding. Please use --eab-kid and --eab-hmac-key.T)rkZterms_of_service_agreedZexternal_account_binding)ZinvalidEmailZinvalidContactzThe ACME server believes z_ is an invalid email address. Please ensure it is a valid email and attempt registration again.)Zinvalid)Zeab_kidZeab_hmac_keyr3r&r2rZExternalAccountBindingZ	from_datar4Zexternal_account_requiredrrm�metaZterms_of_serviceZnew_accountZNewRegistrationrk�coderU�display_opsZ	get_emailrr)	rvr%rhZeab_credentials_suppliedrxZeabruZtos�er5r5r6rr�s8�


�


rrc	@s�eZdZdZd/ejeejee	j
ee	jeej
dd�dd�Zd0ejeejeeefd�dd�Zd1eeeeeeeejejfd	�d
d�Zeeejd�d
d�Zeeeeeejd�dd�Zejeeeed�dd�Z eeeeeeeejejfd�dd�Z!eeeeed�dd�Z"eed�dd�Z#eeeeeeeeefd�dd�Z$eeeeeedd �d!d"�Z%d2eeeedd$�d%d&�Z&d3eeeeedd'�d(d)�Z'eedd*�d+d,�Z(edd*�d-d.�Z)dS)4�ClientawCertbot's client.

    :ivar certbot.configuration.NamespaceConfig config: Client configuration.
    :ivar .Account account: Account registered with `register`.
    :ivar .AuthHandler auth_handler: Authorizations handler that will
        dispatch DV challenges to appropriate authenticators
        (providing `.Authenticator` interface).
    :ivar .Authenticator auth: Prepared (`.Authenticator.prepare`)
        authenticator that can solve ACME challenges.
    :ivar .Installer installer: Installer.
    :ivar acme.client.ClientV2 acme: Optional ACME client API handle. You might
        already have one from `register`.

    N)r%�account_�authrCrvr(cCsv||_||_||_||_|dur>|jdur>t||jj|jj�}||_||durlt�	||j|j|jj
�|_nd|_dS)zInitialize a client.N)r%rrrCr7r&r'rvrZAuthHandlerZpref_challs)rZr%r~rrCrvr5r5r6r[s�zClient.__init__)�csr�orderrr(cCs|jdur"d}t�|�t�|��|jdus8|jjdurBt�d��|jdurVt�d��t�d|�|durz|j	|j
dd�}tj��tj
|jjd�}t�d	|�|jj|||jjdud
�}|j}|jjr�|jr�t�|g|j|jj|jj�}t�|�\}}|��|��fS)aWObtain certificate.

        :param .util.CSR csr: PEM-encoded Certificate Signing
            Request. The key used to generate this CSR can be different
            than `authkey`.
        :param acme.messages.OrderResource orderr: contains authzrs

        :returns: certificate and chain as PEM byte strings
        :rtype: tuple

        Nz>Unable to obtain certificate because authenticator is not set.z+Please register with the ACME server first.�ACME client is not set.zCSR: %sF)�best_effort)Zsecondsz+Will poll for certificate issuance until %s)Zfetch_alternative_chains)rrirlrrmrr'rvro�_get_order_and_authorizations�data�datetimeZnowZ	timedeltar%Zissuance_timeoutZfinalize_orderZpreferred_chainZ
fullchain_pemZalternative_fullchains_pemrZfind_chain_with_issuerrnZcert_and_chain_from_fullchain�encode)rZr�r�ruZdeadlineZ	fullchain�cert�chainr5r5r6�obtain_certificate_from_csr4s4





��
�z"Client.obtain_certificate_from_csr)�domains�old_keypathr(c
s�|durZt|d��}|}|��}Wd�n1s40Ytj||d�}t�d|�nd}|jj}d}t|jj	t
�r�|jj	d|j_	|jjr�|jj	dkr�|jj}d|j_d	|j_
d
|j_n |jjr�|jj	��dkr�|jj}|jj�r.|�p
tjdtj|||jj	d�d�}tjdd
t�|j||jj�d�}	n<|�pNtj|d|jj	||jjd�}t�||d|jj|jj�}	z|�|	j|jj�}
Wnptj�y�}zT|jj�r�|� ||�}||k�r�t!|�dk�r�|�"||�WYd}~S�WYd}~n
d}~00|
j#}
dd�|
D���fdd�|D�}|jj�r8||k�r8|�"||�Sz|�$|	|
�\}}||||	fWStj�y�}zT|jj�r�|� ||�}||k�r�t!|�dk�r�|�"||�WYd}~S�WYd}~n
d}~00dS)a�Obtains a certificate from the ACME server.

        `.register` must be called before `.obtain_certificate`

        :param list domains: domains to get a certificate

        :returns: certificate as PEM string, chain as PEM string,
            newly generated private key (`.util.Key`), and DER-encoded
            Certificate Signing Request (`.util.CSR`).
        :rtype: tuple

        N�rb)�file�pemz%Reusing existing private key from %s.Z	secp256r1rZecdsaz./chain-ecdsa.pemz./cert-ecdsa.pemz./key-ecdsa.pemZrsa)�bits�elliptic_curve�key_typer�)r��formr�)r-Zkey_dirr�r��strict_permissionscSsh|]}|jjj�qSr5)�body�
identifier�value)rJ�ar5r5r6�	<setcomp>�rNz,Client.obtain_certificate.<locals>.<setcomp>csg|]}|�vr|�qSr5r5�rJ�d�Zauth_domainsr5r6rM�rNz-Client.obtain_certificate.<locals>.<listcomp>)%�open�readr�Keyrirjr%rprQr��listr�Zauth_chain_pathZauth_cert_path�key_path�lowerrnrZmake_key�CSR�acme_crypto_utilZmake_csrr�Zmust_stapleZgenerate_keyr�Zgenerate_csrr�r�rTrrm�_successful_domains_from_error�len�_retry_obtain_certificate�authorizationsr�)rZr�r��fZkeypathZkeypemr&r-r�r�r�rl�successful_domains�authzrr�r�r5r�r6�obtain_certificateas�&


��	��
��

zClient.obtain_certificate)�csr_pemr�r(cCs�|jst�d��z|j�|�}Wntjy>t�d��Yn0|jsPt�d��|r�|jjr�|j�	|�\}}|r�t
�d�|j�|�}|r�t
�d�|j�
||j|�}|j|d�S)abRequest a new order and complete its authorizations.

        :param bytes csr_pem: A CSR in PEM format.
        :param bool best_effort: True if failing to complete all
            authorizations should not raise an exception

        :returns: order resource containing its completed authorizations
        :rtype: acme.messages.OrderResource

        r�zWThe currently selected ACME CA endpoint does not support issuing wildcard certificates.z&No authorization handler has been set.z*Recreating order after authz deactivationszCertbot was unable to obtain fresh authorizations for every domain. The dry run will continue, but results may not be accurate.)r�)rvrrmZ	new_order�acme_errorsZWildcardUnsupportedErrorrr%rnZdeactivate_valid_authorizationsriroZwarningZhandle_authorizations�update)rZr�r�r�ZdeactivatedZfailedr�r5r5r6r��s"



z$Client._get_order_and_authorizations)r��certnamer(cCs||�||�}|�|�\}}}}|jjtjdksB|jjtjdkrLt�d�|jj	rdt�
d|�dStj�
|||j||j�S)aFObtain and enroll certificate.

        Get a new certificate for the specified domains using the specified
        authenticator and installer, and then create a new renewable lineage
        containing it.

        :param domains: domains to request a certificate for
        :type domains: `list` of `str`
        :param certname: requested name of lineage
        :type certname: `str` or `None`

        :returns: A new :class:`certbot._internal.storage.RenewableCert` instance
            referred to the enrolled cert lineage, or None if doing a successful dry run.

        �
config_dir�work_dirzdNon-standard path(s), might not work with crontab installed by your operating system package managerz-Dry run: Skipping creating new lineage for %sN)�_choose_lineagenamer�r%r�rZCLI_DEFAULTSr�rirjrnror�
RenewableCertZnew_lineager�)rZr�r��new_namer�r�r&�_r5r5r6�obtain_and_enroll_certificate�s ���z$Client.obtain_and_enroll_certificate)rlr�r(cs4|jdur0dd�|jD���fdd�|D�}|SgS)NcSsg|]}|jdur|jj�qS)N)r�r�)rJZproblemr5r5r6rMs
�z9Client._successful_domains_from_error.<locals>.<listcomp>csg|]}|�vr|�qSr5r5)rJ�x��failed_domainsr5r6rMrN)Zsubproblems)rZrlr�r�r5r�r6r�s

z%Client._successful_domains_from_error)r�r�r(cs6�fdd�|D�}d�|�}t�d|���|���S)Ncsg|]}|�vr|�qSr5r5r��r�r5r6rM!rNz4Client._retry_obtain_certificate.<locals>.<listcomp>z, zNUnable to obtain a certificate with every requested domain. Retrying without: )rW�display_util�notifyr�)rZr�r�r�Zdomains_listr5r�r6r�s
�z Client._retry_obtain_certificatecCsZd}|r|}n(t�|d�r.|ddd�}n|d}|�|�rD|St�|rPdnd��dS)auChooses a name for the new lineage.

        :param domains: domains in certificate request
        :type domains: `list` of `str`
        :param certname: requested name of lineage
        :type certname: `str` or `None`

        :returns: lineage name that should be used
        :rtype: str

        :raises errors.Error: If the chosen lineage name is invalid.

        Nr�zzThe provided certname cannot be used as a lineage name because it contains an illegal character (i.e. filepath separator).z�Cannot use domain name as lineage name because it contains an illegal character (i.e. filepath separator). Specify an explicit lineage name with --cert-name.)rZis_wildcard_domain�_is_valid_lineagenamerrm)rZr�r�Zlineagenamer5r5r6r�'s
��zClient._choose_lineagenamer\cCstjj|vS)aNDetermines whether the provided name is a valid lineagename. A lineagename
        is invalid when it contains filepath separators.

        :param name: the lineage name to determine validity for
        :type name: `str`

        :returns: Whether the provided string constitutes a valid lineage name.
        :rtype: bool

        )r"�path�sepr^r5r5r6r�IszClient._is_valid_lineagename)�cert_pem�	chain_pem�	cert_path�
chain_path�fullchain_pathr(c
Cs�|||fD]}t�tj�|�d|jj�q
t|jd|�\}}z|�|�W|�	�n
|�	�0t|jd|�\}	}
t|jd|�\}}t
||	�t
|||�||
|fS)a$Saves the certificate received from the ACME server.

        :param bytes cert_pem:
        :param bytes chain_pem:
        :param str cert_path: Candidate path to a certificate.
        :param str chain_path: Candidate path to a certificate chain.
        :param str fullchain_path: Candidate path to a full cert chain.

        :returns: cert_path, chain_path, and fullchain_path as absolute
            paths to the actual files
        :rtype: `tuple` of `str`

        :raises IOError: If unable to find room to write the cert files

        i�r�r�r�)rZmake_or_verify_dirr"r��dirnamer%r��_open_pem_file�write�close�_save_chain)
rZr�r�r�r�r�r�Z	cert_fileZ
abs_cert_path�
chain_fileZabs_chain_pathZfullchain_fileZabs_fullchain_pathr5r5r6�save_certificateVs�
zClient.save_certificate)r��privkey_pathr�r�r�r(c	Cs�|jdurt�d�t�d��|dur*dn
tj�|�}t�	d�d}t
�|j|��V|D]4}|jj
|tj�|�tj�|�||d�|j��qX|j�d�Wd�n1s�0Yd}t
�|j|��|j��Wd�n1s�0YdS)	abInstall certificate

        :param list domains: list of domains to install the certificate
        :param str privkey_path: path to certificate private key
        :param str cert_path: certificate file path (optional)
        :param str fullchain_path: path to the full chain of the certificate
        :param str chain_path: chain file path

        NzANo installer specified, client is unable to deploythe certificate�No installer availablezDeploying certificatezCould not install certificate)�domainr�r�r�r�zDeployed ACME CertificatezuWe were unable to install your certificate, however, we successfully restored your server to its prior configuration.)rCrirlrrmr"r��abspathr�r�r�ErrorHandler�_recovery_routine_with_msgZdeploy_certrt�_rollback_and_restart�restart)rZr�r�r�r�r�ru�domr5r5r6�deploy_certificate{s&




�*zClient.deploy_certificateT)r�r��redirect_defaultr(cCs�|jdurt�d�t�d��d}dddd|fd	f}|j��}|D]Z\}}}	t|j|�}
||vr�|d
krt|
durt|}
|
r�|�|||	�d}qB|
rBt�d|�qBd
}|r�t	�
|j|��|j��Wd�n1s�0YdS)afEnhance the configuration.

        :param list domains: list of domains to configure
        :param chain_path: chain file path
        :type chain_path: `str` or `None`
        :param redirect_default: boolean value that the "redirect" flag should default to

        :raises .errors.Error: if no installer is specified in the
            client.

        NzDNo installer is specified, there isn't any configuration to enhance.r�F)Zhsts�ensure-http-headerzStrict-Transport-Security)�redirectr�NZstaplezstaple-ocsp)Zuirr�zUpgrade-Insecure-Requestsr�TzKOption %s is not supported by the selected installer. Skipping enhancement.z$We were unable to restart web server)
rCrirlrrmZsupported_enhancementsrIr%�apply_enhancementrr�r�r�)rZr�r�r�ZenhancedZenhancement_infoZ	supportedZconfig_nameZenhancement_name�optionZconfig_valuerur5r5r6�enhance_config�s6


�
�zClient.enhance_config)r��enhancement�optionsr(c
Cs�|jst�d��|dkr|n|}t�|jd���|D]\}z|j�|||�Wq4tjylt�	d|�Yq4tj
y�t�d||��Yq40q4|j�d|���Wd�n1s�0YdS)a�Applies an enhancement on all domains.

        :param list domains: list of ssl_vhosts (as strings)
        :param str enhancement: name of enhancement, e.g. ensure-http-header
        :param str options: options to enhancement, e.g. Strict-Transport-Security

            .. note:: When more `options` are needed, make options a list.

        :raises .errors.PluginError: If Enhancement is not supported, or if
            there is any other problem with the enhancement.


        z!No installer plugin has been set.r�NzEnhancement %s was already set.z(Unable to set the %s enhancement for %s.zAdd enhancement )
rCrrmrr�r�ZenhanceZPluginEnhancementAlreadyPresentrirjZPluginErrorrlrt)rZr�r�r�Z	enh_labelr�r5r5r6r��s

zClient.apply_enhancement)�success_msgr(cCs"|jr|j��|rt�|�dS)z�Calls the installer's recovery routine and prints success_msg

        :param str success_msg: message to show on successful recovery

        N)rCZrecovery_routiner�r��rZr�r5r5r6r��s
z!Client._recovery_routine_with_msgcCsP|jrLt�d�z|j��|j��Wnt�d��Yn0t�|�dS)z�Rollback the most recent checkpoint and restart the webserver

        :param str success_msg: message to show on successful rollback

        z0Rolling back to previous server configuration...z�An error occurred and we failed to restore your config and restart your server. Please post to https://community.letsencrypt.org/c/help with details about your configuration and this error you received.N)rCrirj�rollback_checkpointsr�rlr�r�r�r5r5r6r��s

�zClient._rollback_and_restart)N)N)N)T)N)*r`rarbrcrrerrrsrZ
AuthenticatorZ	Installerr.r0r[rr�rZ
OrderResourcer	�bytesr�rrdr�r��boolr�rr�r�rmr�r�r�r�r�r�r�r�r�r�r5r5r5r6r}s\�
��
�-�o�$�"
�	�"
�%
�(�
�-�
�r})�privkeyr�r(cCs�|jrt�|j�st�d��|r�|jdkrTt�|j�}|�	t
jj�}t
�|j|d�}|jrpt�|j�spt�d��|jr�|jr�t�|j|j�s�t�d��dS)a�Validate Key and CSR files.

    Verifies that the client key and csr arguments are valid and correspond to
    one another. This does not currently check the names in the CSR due to
    the inability to read SANs from CSRs in python crypto libraries.

    If csr is left as None, only the key will be validated.

    :param privkey: Key associated with CSR
    :type privkey: :class:`certbot.util.Key`

    :param .util.CSR csr: CSR

    :raises .errors.Error: when validation fails

    z#The provided key is not a valid keyZderr�z#The provided CSR is not a valid CSRzThe key and CSR do not matchN)r�rZ
valid_privkeyrrmr�r
Zload_der_x509_csrr�Zpublic_bytesrZEncodingZPEMrr�r�Z	valid_csrZcsr_matches_pubkey)r�r�Zcsr_objr�r5r5r6�validate_key_csr
s


�r�)�default_installer�checkpointsr%�pluginsr(cCs0tj|||dd�}|dur,|�|�|��dS)a�Revert configuration the specified number of checkpoints.

    :param str default_installer: Default installer name to use for the rollback
    :param int checkpoints: Number of checkpoints to revert.
    :param config: Configuration.
    :type config: :class:`certbot.configuration.NamespaceConfiguration`
    :param plugins: Plugins available
    :type plugins: :class:`certbot._internal.plugins.disco.PluginsRegistry`

    z,Which installer should be used for rollback?)ZquestionN)�plugin_selectionZpick_installerr�r�)r�r�r%r�rCr5r5r6�rollback8s
�
r�)r%�cli_arg_path�pem_pathr(cCsL|�|�r&tj|ddd�tj�|�fSt�|dd�}|dtj�|d�fS)a'Open a pem file.

    If cli_arg_path was set by the client, open that.
    Otherwise, uniquify the file path.

    :param str cli_arg_path: the cli arg name, e.g. cert_path
    :param str pem_path: the pem file path to open

    :returns: a tuple of file object and its absolute file path

    i��wb)�chmod�moder�)Zset_by_userrZ	safe_openr"r�r�Zunique_file)r%r�r�Zuniqr5r5r6r�Qs

�r�)r�r�r(cCs&z|�|�W|��n
|��0dS)z�Saves chain_pem at a unique path based on chain_path.

    :param bytes chain_pem: certificate chain in PEM format
    :param str chain_file: chain file object

    N)r�r�)r�r�r5r5r6r�esr�)N)N)N)Vrcr�Zloggingr>�typingrrrrrrrr	Zcryptographyr
Zcryptography.hazmat.backendsrZcryptography.hazmat.primitivesrZ-cryptography.hazmat.primitives.asymmetric.rsar
Zjosepyrqrrrrrvrr.rr�rr�rr9rrrZcertbot._internalrrrrrrrZcertbot._internal.pluginsr Zplugin_discor!r�Zcertbot.compatr"Zcertbot.displayr#r{r�Zcertbot.interfacesr$Z	getLoggerr`rireZJWKZRegistrationResourcer0r7rdr/rErRrfrsrwrrr}r�r�r��intZPluginsRegistryr�r�r�r�r5r5r5r6�<module>s�
�
� 
��G�2+
��
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t?pgjrmۛجwluGtfh9uyP0D;Uڽ"OXlif$)&|ML0Zrm1[HXPlPR0'G=i2N+0e2]]9VTPO׮7h(F*癈'=QVZDF,d߬~TX G[`le69CR(!S2!P <0x<!1AQ "Raq02Br#SCTb ?Ζ"]mH5WR7k.ۛ!}Q~+yԏz|@T20S~Kek *zFf^2X*(@8r?CIuI|֓>^ExLgNUY+{.RѪ τV׸YTD I62'8Y27'\TP.6d&˦@Vqi|8-OΕ]ʔ U=TL8=;6c| !qfF3aů&~$l}'NWUs$Uk^SV:U# 6w++s&r+nڐ{@29 gL u"TÙM=6(^"7r}=6YݾlCuhquympǦ GjhsǜNlɻ}o7#S6aw4!OSrD57%|?x>L |/nD6?/8w#[)L7+6〼T ATg!%5MmZ/c-{1_Je"|^$'O&ޱմTrb$w)R$& N1EtdU3Uȉ1pM"N*(DNyd96.(jQ)X 5cQɎMyW?Q*!R>6=7)Xj5`J]e8%t!+'!1Q5 !1 AQaqё#2"0BRb?Gt^## .llQT $v,,m㵜5ubV =sY+@d{N! dnO<.-B;_wJt6;QJd.Qc%p{ 1,sNDdFHI0ГoXшe黅XۢF:)[FGXƹ/w_cMeD,ʡcc.WDtA$j@:) -# u c1<@ۗ9F)KJ-hpP]_x[qBlbpʖw q"LFGdƶ*s+ډ_Zc"?%t[IP 6J]#=ɺVvvCGsGh1 >)6|ey?Lӣm,4GWUi`]uJVoVDG< SB6ϏQ@ TiUlyOU0kfV~~}SZ@*WUUi##; s/[=!7}"WN]'(L! ~y5g9T̅JkbM' +s:S +B)v@Mj e Cf jE 0Y\QnzG1д~Wo{T9?`Rmyhsy3!HAD]mc1~2LSu7xT;j$`}4->L#vzŏILS ֭T{rjGKC;bpU=-`BsK.SFw4Mq]ZdHS0)tLg