o
    l>j\                     @   s   U d Z ddlZddlZddlZddlmZmZmZ ddlZddl	m
Z
 eeZejed< ej			ddededB d	edB d
ededf fddZdS )z:Context manager to configure SSL verification for requests    N)AnyCallable	Generator)InsecureRequestWarningloggerT
verify_ssl
http_proxyhttps_proxyreturnc                 #   s    t jj fdd}|t j_z1s3t  tdt dV  W d   n1 s-w   Y  n
dV  W t j_dS W t j_dS t j_w )a  Context manager to configure SSL verification for requests

    Warning: Setting verify_ssl=False disables certificate validation,
    making connections vulnerable to man-in-the-middle attacks.
    Only use in trusted environments for testing purposes.
    c                    sJ   | |||||}sd|d< i } r |d< r|d< |r#||d< |S )NFverifyhttphttpsproxies )selfurlr   streamr   certsettingsoverride_proxiesr   r	   old_merge_environment_settingsr   r   I/home/thesage/.local/lib/python3.10/site-packages/pyicloud/ssl_context.py&merge_environment_settings_with_config    s   zMconfigurable_ssl_verification.<locals>.merge_environment_settings_with_configignoreN)requestsSessionmerge_environment_settingswarningscatch_warningssimplefilterr   )r   r   r	   r   r   r   r   configurable_ssl_verification   s    
 r!   )TNN)__doc__
contextlibloggingr   typingr   r   r   r   urllib3.exceptionsr   	getLogger__name__r   Logger__annotations__contextmanagerboolstrr!   r   r   r   r   <module>   s*    