Files
old-parkingkoncept/parkingkonceptvenv/lib/python3.7/site-packages/urllib3/__pycache__/connection.cpython-37.pyc

129 lines
10 KiB
Plaintext
Raw Normal View History

2019-11-17 12:44:16 +01:00
B
#U<>]B;<00> @s<>ddlmZddlZddlZddlZddlZddlmZmZ ddl
Z
ddl m Z ddl mZddl mZyddlZejZWn,eefk
r<EFBFBD>dZGdd <09>d e<16>ZYnXyeZWn$ek
r<EFBFBD>Gd
d <0B>d e<19>ZYnXdd lmZmZmZmZdd lm Z m!Z!ddl"m#Z#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)ddl*m+Z+e<03>,e-<2D>Z.ddd<13>Z/e<02>0ddd<04>Z1Gdd<16>de2<65>Z3Gdd<18>dee2<65>ZGdd<1A>de<0E>Z4Gdd<1C>de4<65>Z5dd<1E>Z6e<11>r<>e4Z7e5Z4ne3Z4dS)<1F>)<01>absolute_importN)<02>error<6F>timeout<75>)<01>six)<01>HTTPConnection)<01> HTTPExceptionc@s eZdZdS)<02> BaseSSLErrorN)<03>__name__<5F>
__module__<EFBFBD> __qualname__<5F>r r <00>7/tmp/pip-install-zuyyrlx8/urllib3/urllib3/connection.pyr sr c@s eZdZdS)<02>ConnectionErrorN)r
r r r r r rrsr)<04>NewConnectionError<6F>ConnectTimeoutError<6F>SubjectAltNameWarning<6E>SystemTimeWarning)<02>match_hostname<6D>CertificateError)<05>resolve_cert_reqs<71>resolve_ssl_version<6F>assert_fingerprint<6E>create_urllib3_context<78>ssl_wrap_socket)<01>
connection)<01>HTTPHeaderDict<63>Pi<>)<02>http<74>httpsi<73>c@seZdZdZdS)<03>DummyConnectionz-Used to detect a failed ConnectionCls import.N)r
r r <00>__doc__r r r rr >sr c@speZdZdZedZejejdfgZ dZ
dd<06>Z e dd<08><00>Z e jd d<08><00>Z d
d <0B>Zd d <0A>Zdd<0F>Zddd<12>ZdS)ra$
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., ``[]``).
rrFcOsDtjs|<02>dd<00>|<02>d<02>|_|<02>d|j<05>|_tj|f|<01>|<02>dS)N<>strict<63>source_address<73>socket_options) r<00>PY2<59>pop<6F>getr#<00>default_socket_optionsr$<00>_HTTPConnection<6F>__init__)<03>self<6C>args<67>kwr r rr*es
  zHTTPConnection.__init__cCs |j<00>d<01>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).
<20>.)<02> _dns_host<73>rstrip)r+r r r<00>hostrszHTTPConnection.hostcCs
||_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+<00>valuer r rr1<00>sc
Cs<>i}|jr|j|d<|jr$|j|d<ytj|j|jf|jf|<01>}WnXtk
rlt|d|j |jf<00><02>Yn0t
k
r<EFBFBD>}zt |d|<00><02>Wdd}~XYnX|S)zp Establish a socket connection and set nodelay settings on it.
:return: New socket connection.
r#r$z0Connection to %s timed out. (connect timeout=%s)z(Failed to establish a new connection: %sN) r#r$r<00>create_connectionr/<00>portr<00> SocketTimeoutrr1<00> SocketErrorr)r+<00>extra_kw<6B>conn<6E>er r r<00> _new_conn<6E>s"

zHTTPConnection._new_conncCs$||_t|dd<00>r |<00><02>d|_dS)N<> _tunnel_hostr)<04>sock<63>getattr<74>_tunnel<65> auto_open)r+r8r r r<00> _prepare_conn<6E>s zHTTPConnection._prepare_conncCs|<00><00>}|<00>|<01>dS)N)r:r@)r+r8r r r<00>connect<63>szHTTPConnection.connectNc Cst|dk r|ni<00>}d|k}d|k}|j||||d<04>x |<04><02>D]\}}|<00>||<08>q@Wd|krl|<00>dd<07>|<00><04>|dk <09>rtjtf} t|| <09>r<>|f}xh|D]`}
|
s<EFBFBD>q<EFBFBD>t|
t<07>s<>|
<EFBFBD> d<08>}
t
t |
<EFBFBD><01>d d<01>} |<00> | <0B> d
<EFBFBD><01>|<00> d <0B>|<00> |
<EFBFBD>|<00> d <0B>q<>W|<00> d <0C>dS) z<>
Alternative to the common request method, which sends the
body with chunked encoding and not as one block
Nzaccept-encodingr1)<02>skip_accept_encoding<6E> skip_hostztransfer-encodingzTransfer-Encoding<6E>chunked<65>utf8<66>zutf-8s
s0
) r<00>
putrequest<EFBFBD>items<6D> putheader<65>
endheadersr<00> string_types<65>bytes<65>
isinstance<EFBFBD>encode<64>hex<65>len<65>send) r+<00>method<6F>url<72>body<64>headersrBrC<00>headerr2<00>stringish_types<65>chunk<6E>len_strr r r<00>request_chunked<65>s2 
 





zHTTPConnection.request_chunked)NN)r
r r r!<00>port_by_scheme<6D> default_port<72>socket<65> IPPROTO_TCP<43> TCP_NODELAYr(<00> is_verifiedr*<00>propertyr1<00>setterr:r@rArZr r r rrDs 
 rc@s<eZdZedZdZdddddejddfdd<04>Zdd<06>Z dS)<07>HTTPSConnectionrNc
KsDtj|||f||d<01>|
<EFBFBD><02>||_||_||_||_| |_d|_dS)N)r"rr)rr*<00>key_file<6C> cert_file<6C> key_password<72> ssl_context<78>server_hostname<6D> _protocol) r+r1r4rdrerfr"rrgrhr-r r rr*<00>szHTTPSConnection.__init__cCs<>|<00><00>}|<00>|<01>d}|jdkr>d}tt|j<05>t|j<07>d<03>|_|j}|jsf|j sf|rft
|d<04>rf|<03> <0B>t ||j |j|j|j|jd<05>|_dS)NFT)<02> ssl_version<6F> cert_reqs<71>load_default_certs)r<<00>keyfile<6C>certfilerfrgrh)r:r@rgrrrjrrk<00>ca_certs<74> ca_cert_dir<69>hasattrrlrrdrerfrhr<)r+r8<00>default_ssl_context<78>contextr r rrA<00>s*


zHTTPSConnection.connect)
r
r r r[r\rjr]<00>_GLOBAL_DEFAULT_TIMEOUTr*rAr r r rrc<00>s rcc@s6eZdZdZdZdZdZdZdZddd<04>Z dd<06>Z
dS)<08>VerifiedHTTPSConnectionz[
Based on httplib.HTTPSConnection but wraps the socket with
SSL certification.
Nc Csp|dkr$|jdk r|jj}ntd<01>}||_||_||_||_||_||_|oVt j
<EFBFBD> |<05>|_ |oht j
<EFBFBD> |<08>|_ dS)zX
This method should only be called once, before the connection is used.
N)rg<00> verify_moderrdrerkrf<00>assert_hostnamer<00>os<6F>path<74>
expanduserrorp) r+rdrerkrfrorwrrpr r r<00>set_cert-s

z VerifiedHTTPSConnection.set_certc
Cs<>|<00><00>}|j}t|dd<00>r4||_|<00><04>d|_|j}|}|jdk rH|j}tj <09>
<EFBFBD>t k}|rlt <0C> d<03>t <0B>t<0F>d}|jdkr<>d}tt|j<13>t|j<15>d<06>|_|j}t|j<15>|_|js<>|js<>|r<>t|d<07>r<>|<06><1A>t||j|j|j|j|j||d<08>|_|j<1F>rt|jj dd <09>|j<1F>nd|jt!j"k<03>rtt|d
d<04><03>st|j#dk <09>rt|j<03> <20>}|<07>$d d <0C><02>sbt <0C> d <0A>|<02>t%<25>t&||j#<23>pp|<03>|jt!j'k<02>p<>|jdk |_(dS)Nr;rzWSystem time is way off (before {0}). This will probably lead to SSL verification errorsFT)rjrkrl)r<rmrnrfrorprhrg)<01> binary_form<72>check_hostname<6D>subjectAltNamer z<>Certificate for {0} has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)))r:r1r=r<r>r?r;rh<00>datetime<6D>date<74>today<61> RECENT_DATE<54>warnings<67>warn<72>formatrrgrrrjrrkrvrorprqrlrrdrerfr<00> getpeercert<72>ssl<73> CERT_NONErwr'r<00>_match_hostname<6D> CERT_REQUIREDr`)r+r8<00>hostnamerh<00> is_time_offrrrs<00>certr r rrALsj 

 

 
zVerifiedHTTPSConnection.connect)NNNNNNNN) r
r r r!rkrorprjrr{rAr r r rru!s
ruc
CsLyt||<01>Wn8tk
rF}zt<02>d||<00>||_<04>Wdd}~XYnXdS)Nz@Certificate did not match expected hostname: %s. Certificate: %s)rr<00>log<6F>warning<6E>
_peer_cert)r<><00>asserted_hostnamer9r r rr<><00>sr<>)8<>
__future__rr<00>loggingrxr]rr6rr5r<><00>packagesrZpackages.six.moves.http_clientrr)rr<><00>SSLErrorr <00> ImportError<6F>AttributeError<6F> BaseExceptionr<00> NameError<6F> Exception<6F>
exceptionsrrrrZpackages.ssl_match_hostnamerrZ util.ssl_rrrrr<00>utilr<00> _collectionsr<00> getLoggerr
r<>r[r<>r<><00>objectr rcrur<><00>UnverifiedHTTPSConnectionr r r r<00><module>sL    
  

B