ok

Mini Shell

Direktori : /opt/alt/python37/lib/python3.7/site-packages/raven/utils/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/raven/utils/__pycache__/http.cpython-37.pyc

B

��Y��@sjdZddlmZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZdej
dddfdd	�ZdS)
z�
raven.utils.http
~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
�)�absolute_importN)�defaults)�urllib2�httplib)�match_hostnameFc
	s�G��fdd�dtj��G�fdd�dtj�}|r:|g}n0ytjt��d�g}Wntk
rhg}YnXtj|�}tj	dkr�t
��}	t
�|�z|�
||�St
�|	�X|�
|||�S)Ncs(eZdZejZdd�Z��fdd�ZdS)z%urlopen.<locals>.ValidHTTPSConnectionc_stjj|f|�|�dS)N)r�HTTPConnection�__init__)�self�args�kwargs�r�A/opt/alt/python37/lib/python3.7/site-packages/raven/utils/http.pyrsz.urlopen.<locals>.ValidHTTPSConnection.__init__csdtj|j|jf|jd�}|jr,||_|��tj	|�tj
d�|_�dk	r`t|j��|j
p\|j�dS)N)Zaddress�timeout)�ca_certsZ	cert_reqs)�socketZcreate_connectionZhostZportrZ_tunnel_host�sockZ_tunnel�sslZwrap_socketZ
CERT_REQUIREDrZgetpeercert�assert_hostname)r	r)rrrr
�connects


z-urlopen.<locals>.ValidHTTPSConnection.connectN)�__name__�
__module__�__qualname__rZ
HTTPS_PORTZdefault_portrrr)rrrr
�ValidHTTPSConnectionsrcseZdZ�fdd�ZdS)z"urlopen.<locals>.ValidHTTPSHandlercs|��|�S)N)Zdo_open)r	Zreq)rrr
�
https_open-sz-urlopen.<locals>.ValidHTTPSHandler.https_openN)rrrrr)rrr
�ValidHTTPSHandler,sr)�context)��)rrrZHTTPSHandlerrZ_create_unverified_context�AttributeErrorZbuild_opener�sys�version_inforZgetdefaulttimeoutZsetdefaulttimeout�open)
Zurl�datarrZ
verify_sslrrZhandlers�openerZdefault_timeoutr)rrrr
�urlopens"



r$)�__doc__Z
__future__rrrrZ
raven.confrZraven.utils.compatrrZraven.utils.ssl_match_hostnamerZTIMEOUTr$rrrr
�<module>s

Zerion Mini Shell 1.0