Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / urllib3 / connection.pyc
Size: Mime:
ó
èEYc@@s\ddlmZddlZddlZddlZddlZddlZddlmZm	Z
ddlZddlm
Z
ddlmZddlmZyddlZejZWn3eefk
rìdZdefd	„ƒYZnXy
eZWn'ek
r d
efd„ƒYZnXddlmZmZmZm Z 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/ƒZ0idd6dd6Z1ej2dddƒZ3de4fd„ƒYZ5dee4fd„ƒYZdefd„ƒYZ6de6fd„ƒYZ7d„Z8erRe6Z9e7Z6ne5Z6dS(i(tabsolute_importN(terrorttimeouti(tsix(tHTTPConnection(t
HTTPExceptiontBaseSSLErrorcB@seZRS((t__name__t
__module__(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyRstConnectionErrorcB@seZRS((RR(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyR	s(tNewConnectionErrortConnectTimeoutErrortSubjectAltNameWarningtSystemTimeWarning(tmatch_hostnametCertificateError(tresolve_cert_reqstresolve_ssl_versiontassert_fingerprinttcreate_urllib3_contexttssl_wrap_socket(t
connection(tHTTPHeaderDictiPthttpi»thttpsiàtDummyConnectioncB@seZdZRS(s-Used to detect a failed ConnectionCls import.(RRt__doc__(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyRAsRcB@sieZdZedZejejdfgZe	Z
d„Zd„Zd„Z
d„Zddd„ZRS(	s{
    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.

        .. note:: This is ignored for Python 2.6. It is only applied for 2.7 and 3.x

      - ``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., ``[]``).
    RicO@stjr|jddƒn|jdƒ|_tjdkrP|jddƒn|jd|jƒ|_	t
j|||ŽdS(Ntstricttsource_addressiitsocket_options(ii(RtPY3tpoptNonetgetRtsystversion_infotdefault_socket_optionsRt_HTTPConnectiont__init__(tselftargstkw((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyR&js	cC@s¾i}|jr|j|d<n|jr8|j|d<ny(tj|j|jf|j|}WnWtk
r”}t|d|j|jfƒ‚n&t	k
r¹}t
|d|ƒ‚nX|S(sp Establish a socket connection and set nodelay settings on it.

        :return: New socket connection.
        RRs0Connection to %s timed out. (connect timeout=%s)s(Failed to establish a new connection: %s(RRRtcreate_connectionthosttportRt
SocketTimeoutRtSocketErrorR
(R'textra_kwtconnte((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyt	_new_conns 		"cC@s5||_t|ddƒr1|jƒd|_ndS(Nt_tunnel_hosti(tsocktgetattrR t_tunnelt	auto_open(R'R0((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyt
_prepare_connšs	
cC@s|jƒ}|j|ƒdS(N(R2R8(R'R0((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pytconnect¥scC@sŠt|d
k	r|niƒ}d|k}d|k}|j||d|d|ƒx*|jƒD]\}}|j||ƒq_Wd|krž|jddƒn|jƒ|d
k	rytjtjf}	t	||	ƒrâ|f}nx”|D]‰}
|
sûqént	|
tjƒs|
j
dƒ}
ntt|
ƒƒd	}|j
|j
d
ƒƒ|j
dƒ|j
|
ƒ|j
dƒqéWn|j
dƒd
S(sƒ
        Alternative to the common request method, which sends the
        body with chunked encoding and not as one block
        saccept-encodingR+tskip_accept_encodingt	skip_hoststransfer-encodingsTransfer-Encodingtchunkedtutf8isutf-8s
s0

N(RR t
putrequesttitemst	putheadert
endheadersRtstring_typestbinary_typet
isinstancetencodethextlentsend(R'tmethodturltbodytheadersR:R;theadertvaluetstringish_typestchunktlen_str((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pytrequest_chunked©s8



N(RRRtport_by_schemetdefault_porttsockettIPPROTO_TCPtTCP_NODELAYR$tFalsetis_verifiedR&R2R8R9R RR(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyRFs
				tHTTPSConnectioncB@s?eZedZdZddddejdd„Zd„Z	RS(Rc		K@sJtj|||d|d||||_||_||_d|_dS(NRRR(RR&tkey_filet	cert_filetssl_contextt	_protocol(	R'R+R,R[R\RRR]R)((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyR&Õs
			c	C@s€|jƒ}|j|ƒ|jdkrOtdtdƒdtdƒƒ|_ntd|d|jd|j	d|jƒ|_
dS(Ntssl_versiont	cert_reqsR4tkeyfiletcertfileR](R2R8R]R RRRRR[R\R4(R'R0((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyR9äs
		N(
RRRSRTR R_RUt_GLOBAL_DEFAULT_TIMEOUTR&R9(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyRZÐs
		
tVerifiedHTTPSConnectioncB@sSeZdZdZdZdZdZdZdddddddd„Z	d„Z
RS(s[
    Based on httplib.HTTPSConnection but wraps the socket with
    SSL certification.
    cC@s©|dkrB|s|r!d}qB|jdk	rB|jj}qBn||_||_||_||_||_|o„tj	j
|ƒ|_|oŸtj	j
|ƒ|_dS(sX
        This method should only be called once, before the connection is used.
        t
CERT_REQUIREDN(
R R]tverify_modeR[R\R`tassert_hostnameRtostpatht
expandusertca_certstca_cert_dir(R'R[R\R`RkRgRRl((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pytset_certs						cC@sü|jƒ}|j}t|ddƒrO||_|jƒd|_|j}ntj	j
ƒtk}|r†tj
djtƒtƒn|jdkrÂtdt|jƒdt|jƒƒ|_n|j}t|jƒ|_td|d|jd|jd	|jd
|jd|d|ƒ|_|jrJt|jjd
tƒ|jƒnŠ|jtj krÔt|dt!ƒrÔ|j"t!k	rÔ|jjƒ}|j#ddƒs»tj
dj|ƒt$ƒnt%||j"pÍ|ƒn|jtj&kpò|jdk	|_'dS(NR3isWSystem time is way off (before {0}). This will probably lead to SSL verification errorsR_R`R4RaRbRkRltserver_hostnameR]tbinary_formtcheck_hostnametsubjectAltNamesê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.)(((R2R+R5R R4R6R7R3tdatetimetdatettodaytRECENT_DATEtwarningstwarntformatR
R]RRR_RR`RfRR[R\RkRlRtgetpeercerttTruetsslt	CERT_NONERXRgR!Rt_match_hostnameReRY(R'R0thostnametis_time_offtcontexttcert((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyR9sT		
	
						

N(RRRR R`RkRlR_RRmR9(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyRdöscC@sJyt||ƒWn2tk
rE}tjd||ƒ||_‚nXdS(Ns@Certificate did not match expected hostname: %s. Certificate: %s(RRtlogRt
_peer_cert(Rtasserted_hostnameR1((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyR}bs
	(:t
__future__RRrtloggingRhR"RURR.RR-RvtpackagesRtpackages.six.moves.http_clientRR%RR{tSSLErrorRtImportErrortAttributeErrorR t
BaseExceptionR	t	NameErrort	Exceptiont
exceptionsR
RRR
tpackages.ssl_match_hostnameRRt	util.ssl_RRRRRtutilRt_collectionsRt	getLoggerRR‚RSRsRutobjectRRZRdR}tUnverifiedHTTPSConnection(((sG/home/tvault/.virtenv/lib/python2.7/site-packages/urllib3/connection.pyt<module>sN


"(	
Š&l