Your IP : 3.135.249.119
3
h��f
8 � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlZd dlmZm Z
d dlZddlm
Z
ddlmZ ddlmZ yd dlZejZW n, eefk
r� dZG dd � d e�ZY nX yeZW n$ ek
r� G d
d� de�ZY nX ddlmZmZmZmZ dd
l m!Z!m"Z" ddl#m$Z$m%Z%m&Z&m'Z'm(Z( ddl)m*Z* ddl+m,Z, ej-e.�Z/ddd�Z0ej1ddd�Z2ej3d�Z4G dd� de5�Z6G dd� dee5�ZG dd� de�Z7G dd� de7�Z8dd � Z9e�r�e7Z:e8Z7ne6Z7dS )!� )�absolute_importN)�error�timeout� )�six)�HTTPConnection)�
HTTPExceptionc @ s e Zd ZdS )�BaseSSLErrorN)�__name__�
__module__�__qualname__� r
r
� /usr/lib/python3.6/connection.pyr s r c @ s e Zd ZdS )�ConnectionErrorN)r
r r r
r
r
r r s r )�NewConnectionError�ConnectTimeoutError�SubjectAltNameWarning�SystemTimeWarning)�match_hostname�CertificateError)�resolve_cert_reqs�resolve_ssl_version�assert_fingerprint�create_urllib3_context�ssl_wrap_socket)�
connection)�HTTPHeaderDict�P i� )�http�httpsi� �
z[^-!#$%&'*+.^_`|~0-9a-zA-Z]c @ s e Zd ZdZdS )�DummyConnectionz-Used to detect a failed ConnectionCls import.N)r
r r �__doc__r
r
r
r r! D s r! c @ sx e Zd ZdZed ZejejdfgZ dZ
dd� Zedd� �Z
e
jd d� �Z
d
d� Zdd
� Zdd� Zdd� Zddd�ZdS )r a$
Based on httplib.HTTPConnection but provides an extra constructor
backwards-compatibility layer between older and newer Pythons.
Additional keyword parameters are used to configure attributes of the connection.
Accepted parameters include:
- ``strict``: See the documentation on :class:`urllib3.connectionpool.HTTPConnectionPool`
- ``source_address``: Set the source address for the current connection.
- ``socket_options``: Set specific options on the underlying socket. If not specified, then
defaults are loaded from ``HTTPConnection.default_socket_options`` which includes disabling
Nagle's algorithm (sets TCP_NODELAY to 1) unless the connection is behind a proxy.
For example, if you wish to enable TCP Keep Alive in addition to the defaults,
you might pass::
HTTPConnection.default_socket_options + [
(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
]
Or you may want to disable the defaults by passing an empty list (e.g., ``[]``).
r r Fc O sD t jr|jdd � |jd�| _|jd| j�| _tj| f|�|� d S )N�strict�source_address�socket_options) r ZPY3�pop�getr$ �default_socket_optionsr% �_HTTPConnection�__init__)�self�args�kwr
r
r r* j s
zHTTPConnection.__init__c C s | j jd�S )a�
Getter method to remove any trailing dots that indicate the hostname is an FQDN.
In general, SSL certificates don't include the trailing dot indicating a
fully-qualified domain name, and thus, they don't validate properly when
checked against a domain name that includes the dot. In addition, some
servers may not expect to receive the trailing dot when provided.
However, the hostname with trailing dot is critical to DNS resolution; doing a
lookup with the trailing dot will properly only resolve the appropriate FQDN,
whereas a lookup without a trailing dot will search the system's search domain
list. Thus, it's important to keep the original host around for use only in
those cases where it's appropriate (i.e., when doing DNS lookup to establish the
actual TCP connection across which we're going to send HTTP requests).
�.)� _dns_host�rstrip)r+ r
r
r �hostw s zHTTPConnection.hostc C s
|| _ dS )z�
Setter for the `host` property.
We assume that only urllib3 uses the _dns_host attribute; httplib itself
only uses `host`, and it seems reasonable that other libraries follow suit.
N)r/ )r+ �valuer
r
r r1 � s c C s� i }| j r| j |d<