Re}8@sOddlmZddlZddlZddlZddlZddlZddlmZm Z ddl Z ddl m Z ddlmZddlmZyddlZejZWn4eefk rdZGdd d eZYnXy eZWn(ek r"Gd d d eZYnXdd lmZmZmZmZdd 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/ddddiZ0ej1dddZ2ej3dZ4Gddde5Z6Gdddee5ZGdddeZ7ddZ8esEe6Z7e7Z9dS))absolute_importN)errortimeout)six)HTTPConnection) HTTPExceptionc@seZdZdS) BaseSSLErrorN)__name__ __module__ __qualname__r r /builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/urllib3/connection.pyr s r c@seZdZdS)ConnectionErrorN)r r r r r r rrs r)NewConnectionErrorConnectTimeoutErrorSubjectAltNameWarningSystemTimeWarning)match_hostnameCertificateError)resolve_cert_reqsresolve_ssl_versionassert_fingerprintcreate_urllib3_contextssl_wrap_socket) connection)HTTPHeaderDicthttpPhttpsiiz[^-!#$%&'*+.^_`|~0-9a-zA-Z]c@seZdZdZdS)DummyConnectionz-Used to detect a failed ConnectionCls import.N)r r r __doc__r r r rr As r c@seZdZdZedZejejdfgZ dZ ddZ e ddZ e jd dZ d d Zd d ZddZddZddddZdS)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., ``[]``). rrFcOsZtjs|jdd|jd|_|jd|j|_tj|||dS)Nstrictsource_addresssocket_options) rPY2popgetr#default_socket_optionsr$_HTTPConnection__init__)selfargskwr r rr*hs  zHTTPConnection.__init__cCs|jjdS)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_hostrstrip)r+r r rhostuszHTTPConnection.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+valuer r rr1scCsi}|jr|j|d<|jr2|j|dt|dd r>|j$dk r>|jj!}|j%dfs(t j dj|t&t'||j$p:||jt"j(kp\|j dk |_)dS)Nr;rzWSystem time is way off (before {0}). This will probably lead to SSL verification errorsFT ssl_versionrqload_default_certsr<keyfilecertfilerlrvrwrxrnrm binary_formcheck_hostnamesubjectAltNamezCertificate 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/urllib3/urllib3/issues/497 for details.))*r:r1r=r<r>r?r;rndatetimedatetoday RECENT_DATEwarningswarnformatrrmrrrzrrqrprvrwrxhasattrr{rrjrkrlr getpeercertssl CERT_NONErrr'r_match_hostname CERT_REQUIREDrf)r+r8hostnamern is_time_offdefault_ssl_contextcontextcertr r rrA2sn                    zHTTPSConnection.connect)r r r rarbrqrvrwrxrzrrc_GLOBAL_DEFAULT_TIMEOUTr*ryrAr r r rris2  ricCs\yt||WnDtk rW}z$tjd||||_WYdd}~XnXdS)Nz@Certificate did not match expected hostname: %s. Certificate: %s)rrlogwarning _peer_cert)rasserted_hostnamer9r r rrs r): __future__rrerloggingrsrcrr6rr5rpackagesrZpackages.six.moves.http_clientrr)rrSSLErrorr ImportErrorAttributeError BaseExceptionr NameError Exception exceptionsrrrrZpackages.ssl_match_hostnamerrZ util.ssl_rrrrrutilr _collectionsr getLoggerr rrarrcompilerBobjectr rirVerifiedHTTPSConnectionr r r rsH          "(