| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/sphinx/util/__pycache__/ |
Upload File : |
a
�ab � @ sh d Z ddlZddlZddlmZ ddlmZmZmZ ddl m
Z
ddlZddlZddl
mZ ddlmZ zddlmZ W n ey� ddlmZ Y n0 zdd lmZ W n: ey� zdd lmZ W n ey� dZY n0 Y n0 d
gZeed�dd
�Zeeed d�dd��Zeeeeef d�dd�Zeed�dd�Zeeejd�dd�Zeeejd�dd�Z dS )z�
sphinx.util.requests
~~~~~~~~~~~~~~~~~~~~
Simple requests package loader
:copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)�contextmanager)�Any� Generator�Union)�urlsplit)�Config)�RemovedInSphinx50Warning)�SSLError)�InsecureRequestWarning)�
User-AgentzDMozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0)�exc�returnc C sD t �dt� t| t�rdS t| dg �}|r<t|d t�r<dS dS dS )zCheck an exception is SSLError.z`is_ssl_error() is outdated and likely returns incorrect results for modern versions of Requests.T�argsr FN)�warnings�warnr �
isinstancer �getattr)r r � r �8/usr/lib/python3.9/site-packages/sphinx/util/requests.py�is_ssl_error- s �
r )NNN)�kwargsr
c k sN t �� �2 | �d�s&tr&t jdtd� d V W d � n1 s@0 Y d S )N�verify�ignore)�category)r �catch_warnings�getr
�filterwarnings)r r r r �ignore_insecure_warning= s
r )�url�configr
c C sb |j s
dS t|dd�}|sdS t|ttf�r0|S t| �d }d|v rR|�d�d }|�|d�S dS )z�Get additional CA cert for a specific URL.
This also returns ``False`` if verification is disabled.
And returns ``True`` if additional CA cert not found.
FZtls_cacertsNT� �@)Z
tls_verifyr r �str�tupler �splitr )r r Zcerts�hostnamer r r �_get_tls_cacertF s r&