3 گā � @ s d Z ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm Z dd lmZ dd lmZ ddlm Z ddlZddlmZ dd lmZ ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlm Z ddlm!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, ddl*m-Z. ddl/m0Z0 ddl1m2Z3 ddl1m!Z4 dd l5m6Z6 ej7e8�Z9dBej:ej;eej< ej=d!�d"d#�Z>ej:e?d$�d%d&�Z@ej:e?d$�d'd(�ZAG d)d*� d*�ZBe?d+�d,d-�ZCdCej:e6eee?gdf ee#jDej=f d.�d/d0�ZEej=ej:eee?gdf ej<d1�d2d3�ZFG d4d5� d5�ZGdDe!jHee!jI dd6�d7d8�ZJe?eKej:e,jLdd9�d:d;�ZMe?e?ee e?f d<�d=d>�ZNeOe dd?�d@dA�ZPdS )EzCertbot client API.� N)�cast)�Any)�Callable)�Dict)�IO)�List)�Optional)�Tuple)�Union)�default_backend)�generate_private_key)�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�returnc C sn t j||| j t| �d�}tj� �B tjdt� t j||| j �}|j dkrXtjd| j � t t j|�S Q R X dS )z Wrangle ACME client construction)r Z verify_ssl� user_agent�ignore� z�Certbot is configured to use an ACMEv1 server (%s). ACMEv1 support is deprecated and will soon be removed. See https://community.letsencrypt.org/t/143839 for more information.N)�acme_clientZ ClientNetworkZ no_verify_ssl�determine_user_agent�warnings�catch_warnings�simplefilter�DeprecationWarning�BackwardsCompatibleClientV2�serverZacme_version�logger�warningr �ClientV2)r r! r"