ó U!¶\c@s:ddlZddlZddlZddlmZddlmZmZm Z m Z ddl m Z m Z mZmZmZddlmZddlmZddlmZddlmZmZmZydd lmZWn!ek rdd l mZnXddlZ dd l!m"Z"dd l#m$Z$dd l%m&Z&m'Z'ddl(m)Z)m*Z*m+Z+mZm,Z,mZmZe&ƒej-e.ƒZ/dZ0dZ1ej2j3ej2j4e5ƒdƒZ6yddl7m8Z8Wnek rëd„Z8nXd„Z9ddddd„Z;de<fd„ƒYZ=de<fd„ƒYZ>dS(iÿÿÿÿN(t b64encode(t PoolManagert ProxyManagertproxy_from_urltTimeout(tsslt OP_NO_SSLv2t OP_NO_SSLv3tOP_NO_COMPRESSIONtDEFAULT_CIPHERS(tSSLError(tReadTimeoutError(tConnectTimeoutError(tNewConnectionErrort ProtocolErrort ProxyError(torig_util_SSLContext(t SSLContext(tsix(tunquote(tfilter_ssl_warningsturlparse(tConnectionClosedErrortEndpointConnectionErrortHTTPClientErrorR tProxyConnectionErrorR R i<i s cacert.pem(twherecCstS(N(tDEFAULT_CA_BUNDLE(((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyR&scCs|tk r|StƒS(N(tTrueR(tverify((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyt get_cert_path*s cCsËt|ptjƒ}|dkr*tjn|}|dkrcd}|tO}|tO}|tO}n|j|O_t |dt ƒrš|j |p“t ƒn||_ t |ddƒdk rÇt|_n|S(s× This function is a vendored version of the same function in urllib3 We vendor this function to ensure that the SSL contexts we construct always use the std lib SSLContext instead of pyopenssl. itsupports_set_cipherstcheck_hostnameN(RRtPROTOCOL_SSLv23tNonet CERT_REQUIREDRRRtoptionstgetattrRt set_ciphersR t verify_modetFalseR (t ssl_versiont cert_reqsR$tcipherstcontext((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pytcreate_urllib3_context1s      tProxyConfigurationcBsGeZdZdd„Zd„Zd„Zd„Zd„Zd„Z RS(söRepresents a proxy configuration dictionary. This class represents a proxy configuration dictionary and provides utility functions to retreive well structured proxy urls and proxy headers from the proxy configuration dictionary. cCs"|dkri}n||_dS(N(R"t_proxies(tselftproxies((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyt__init__]s  cCs=t|ƒ}|jj|jƒ}|r9|j|ƒ}n|S(s7Retrirves the corresponding proxy url for a given url. (RR/tgettschemet_fix_proxy_url(R0turlt parsed_urltproxy((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyt proxy_url_forbs  cCsJi}|j|ƒ\}}|rF|rF|j||ƒ}||dR?tauth_strt encoded_str((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyR;{s!cCsKt|ƒ}y t|jƒt|jƒfSWnttfk rFdSXdS(N(NN(RRR>R?tAttributeErrort TypeErrorR"(R0R6R7((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyR:€s   N( t__name__t __module__t__doc__R"R2R9RAR5R;R:(((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyR.Vs    tURLLib3SessioncBsteZdZed d ed d d„Zd„Zd„Zd„Z d„Z d„Z d d„Z d„Z d „ZRS( s_A basic HTTP client that supports connection pooling and proxies. This class is inspired by requests.adapters.HTTPAdapter, but has been boiled down to meet the use cases needed by botocore. For the most part this classes matches the functionality of HTTPAdapter in requests v2.7.0 (the same as our vendored version). The only major difference of note is that we currently do not support sending chunked requests. While requests v2.7.0 implemented this themselves, later version urllib3 support this directly via a flag to urlopen so enabling it if needed should be trivial. cCs=||_td|ƒ|_itjjd6tjjd6|_|dkrSt }nt |t t fƒsˆt d|dd|dƒ}nd|_d|_t |tƒrµ||_n$t |tƒrÙ|\|_|_n||_||_||_|dkr g|_ni|_t|jƒ|_|j|j_dS(NR1thttpthttpstconnectitreadi(t_verifyR.t _proxy_configtbotocoret awsrequesttAWSHTTPConnectionPooltAWSHTTPSConnectionPoolt_pool_classes_by_schemeR"tDEFAULT_TIMEOUTt isinstancetinttfloatRt _cert_filet _key_filetstrttuplet_timeoutt_max_pool_connectionst_socket_optionst_proxy_managersRt_get_pool_manager_kwargst_managertpool_classes_by_scheme(R0RR1ttimeouttmax_pool_connectionstsocket_optionst client_cert((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyR2“s.              cKs]itd6|jd6|jd6|jƒd6|jd6|jd6|jd6}|j||S(NtstrictRjtmaxsizet ssl_contextRlt cert_filetkey_file(RRcRdt_get_ssl_contextReR_R`tupdate(R0t extra_kwargstpool_manager_kwargs((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyRg¶s       cCstƒS(N(R-(R0((s8/tmp/pip-install-usGedi/botocore/botocore/httpsession.pyRsÃscCsi||jkr^|jj|ƒ}|jd|ƒ}t||}|j|_||j|s@   "(  4!   $2