Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ÝPfú;ã@s,dZddlmZddlZddlmZddlmZ ddl m Z ddl m Z mZddlmZydd l mZWn$ek rŒdZd d lmZYnXddlZddlZd d lmZddlZd d lmZddgZdZejej j!ej"ej j#iZ$e%edƒoöe%ej dƒ�rej j&e$ej'<e%edƒ�r0e%ej dƒ�r0ej j(e$ej)<ye$j*ej+ej j,iƒWne-k �r^YnXej.ej j/ej0ej j1ej2ej j1ej j3iZ4e5dd„e4j6ƒDƒƒZ7dZ8ejZ9ej:j;ZƒZ?dd„Z@dd„ZAdd„ZBdd„ZCdd„ZDGd d!„d!eEƒZFe�rd*d#d$„ZGneZGeGeF_GGd%d&„d&eEƒZHd'd(„ZIdS)+ab SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested with 16.0.0) * cryptography (minimum 1.3.4, from pyopenssl) * idna (minimum 2.0, from cryptography) However, pyopenssl depends on cryptography, which depends on idna, so while we use all three directly here we end up having relatively few packages required. You can install them with the following command: pip install pyopenssl cryptography idna To activate certificate checking, call :func:`~urllib3.contrib.pyopenssl.inject_into_urllib3` from your Python code before you begin making HTTP requests. This can be done in a ``sitecustomize`` module, or at any other time before your application begins using ``urllib3``, like this:: try: import urllib3.contrib.pyopenssl urllib3.contrib.pyopenssl.inject_into_urllib3() except ImportError: pass Now you can use :mod:`urllib3` as you normally would, and it will support SNI when the required modules are installed. Activating this module also has the positive side effect of disabling SSL/TLS compression in Python 2 (see `CRIME attack`_). If you want to configure the default list of supported cipher suites, you can set the ``urllib3.contrib.pyopenssl.DEFAULT_SSL_CIPHER_LIST`` variable. .. _sni: https://en.wikipedia.org/wiki/Server_Name_Indication .. _crime attack: https://en.wikipedia.org/wiki/CRIME_(security_exploit) é)Úabsolute_importN)Úx509)Úbackend)Ú _Certificate)ÚtimeoutÚerror)ÚBytesIO)Ú _fileobjecté)Úbackport_makefile)Úsix)ÚutilÚinject_into_urllib3Úextract_from_urllib3TÚPROTOCOL_TLSv1_1ÚTLSv1_1_METHODÚPROTOCOL_TLSv1_2ÚTLSv1_2_METHODccs|]\}}||fVqdS)N©)Ú.0ÚkÚvrrú/usr/lib/python3.6/pyopenssl.pyú `sri@cCs.tƒttj_tt_ttj_dt_dtj_dS)z7Monkey-patch urllib3 with PyOpenSSL-backed SSL-support.TN)Ú_validate_dependencies_metÚPyOpenSSLContextr Ússl_Ú SSLContextÚHAS_SNIÚ IS_PYOPENSSLrrrrrms cCs(ttj_tt_ttj_dt_dtj_dS)z4Undo monkey-patching by :func:`inject_into_urllib3`.FN)Úorig_util_SSLContextr rrÚorig_util_HAS_SNIrrrrrrrys cCsRddlm}t|ddƒdkr$tdƒ‚ddlm}|ƒ}t|ddƒdkrNtdƒ‚dS) z{ Verifies that PyOpenSSL's package-level dependencies have been met. Throws `ImportError` if they are not met. r)Ú ExtensionsÚget_extension_for_classNzX'cryptography' module missing required functionality. Try upgrading to v1.3.4 or newer.)ÚX509Ú_x509zS'pyOpenSSL' module missing required functionality. Try upgrading to v0.14 or newer.)Zcryptography.x509.extensionsr"ÚgetattrÚ ImportErrorZOpenSSL.cryptor$)r"r$rrrrrƒs  rcCs(dd„}||ƒ}tjdkr$|jdƒ}|S)a³ Converts a dNSName SubjectAlternativeName field to the form used by the standard library on the given Python version. Cryptography produces a dNSName as a unicode string that was idna-decoded from ASCII bytes. We need to idna-encode that string to get it back, and then on Python 3 we also need to convert to unicode via UTF-8 (the stdlib uses PyUnicode_FromStringAndSize on it, which decodes via UTF-8). cSsNddl}x:dD]2}|j|ƒr|t|ƒd…}|jdƒ|j|ƒSqW|j|ƒS)zÒ Borrowed wholesale from the Python Cryptography Project. It turns out that we can't just safely call `idna.encode`: it can explode for wildcard names. This avoids that problem. rNú*.Ú.Úascii)r(r))ÚidnaÚ startswithÚlenÚencode)Únamer+ÚprefixrrrÚ idna_encode¡s   z'_dnsname_to_stdlib..idna_encodeérzutf-8)r2r)ÚsysÚ version_infoÚdecode)r/r1rrrÚ_dnsname_to_stdlib—s   r6cCsºt|dƒr|jƒ}n tt|jƒ}y|jjtjƒj }WnNtj k rJgStj tj tj tfk r‚}ztjd|ƒgSd}~XnXdd„|jtjƒDƒ}|jdd„|jtjƒDƒƒ|S)zU Given an PyOpenSSL certificate, provides all the subject alternative names. Úto_cryptographyz­A problem was encountered with the certificate that prevented urllib3 from finding the SubjectAlternativeName field. This can affect certificate validation. The error was %sNcSsg|]}dt|ƒf‘qS)ZDNS)r6)rr/rrrú Ýsz%get_subj_alt_name..css|]}dt|ƒfVqdS)z IP AddressN)Ústr)rr/rrrrász$get_subj_alt_name..)Úhasattrr7rÚopenssl_backendr%Ú extensionsr#rZSubjectAlternativeNameÚvalueZExtensionNotFoundZDuplicateExtensionZUnsupportedExtensionZUnsupportedGeneralNameTypeÚ UnicodeErrorÚlogZwarningZget_values_for_typeZDNSNameÚextendZ IPAddress)Z peer_certZcertZextÚeÚnamesrrrÚget_subj_alt_nameµs(     rCc@s|eZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z d dd„Zdd„Zdd„ZdS)!Ú WrappedSocketz§API-compatibility wrapper for Python OpenSSL's Connection-class. Note: _makefile_refs, _drop() and _reuse() are needed for the garbage collector of pypy. TcCs"||_||_||_d|_d|_dS)NrF)Ú connectionÚsocketÚsuppress_ragged_eofsÚ_makefile_refsÚ_closed)ÚselfrErFrGrrrÚ__init__ïs zWrappedSocket.__init__cCs |jjƒS)N)rFÚfileno)rJrrrrLöszWrappedSocket.filenocCs*|jdkr|jd8_|jr&|jƒdS)Nré)rHrIÚclose)rJrrrÚ_decref_socketiosús zWrappedSocket._decref_socketioscOsây|jj||Ž}WnÆtjjk rX}z&|jr<|jdkr§sz2PyOpenSSLContext.load_cert_chain..)rxZuse_certificate_fileZ set_passwd_cbZuse_privatekey_file)rJZcertfileZkeyfiler„r)r„rÚload_cert_chain¤s z PyOpenSSLContext.load_cert_chainFTc CsÈtjj|j|ƒ}t|tjƒr&|jdƒ}|dk r8|j|ƒ|j ƒx|y |j ƒWnhtjj k r„t j ||jƒƒ}|s~tdƒ‚wBYn4tjjk r¶}ztjd|ƒ‚WYdd}~XnXPqBWt||ƒS)Nzutf-8zselect timed outzbad handshake: %r)rTrUZ Connectionrxr€r r�r.Zset_tlsext_host_nameZset_connect_stateZ do_handshaker\r r]r^rrkÚsslZSSLErrorrD) rJZsockZ server_sideZdo_handshake_on_connectrGZserver_hostnameÚcnxrarArrrÚ wrap_socketªs$     zPyOpenSSLContext.wrap_socket)NNN)NN)FTTN)rorprqrrrKÚpropertyrzÚsetterr|rr‚rƒr†r‰rrrrrss   rcCs|dkS)Nrr)rˆrZerr_noZ err_depthZ return_coderrrr~Æsr~rR)rR)JrrZ __future__rZ OpenSSL.SSLrTZ cryptographyrZ$cryptography.hazmat.backends.opensslrr;Z)cryptography.hazmat.backends.openssl.x509rrFrrrXÚiorr r'Zpackages.backports.makefiler Zloggingr‡Zpackagesr r3Úr Ú__all__rZPROTOCOL_SSLv23rUZ SSLv23_METHODZPROTOCOL_TLSv1Z TLSv1_METHODrvr:rrrrÚupdateZPROTOCOL_SSLv3Z SSLv3_METHODÚAttributeErrorZ CERT_NONEZ VERIFY_NONEZ CERT_OPTIONALZ VERIFY_PEERZ CERT_REQUIREDZVERIFY_FAIL_IF_NO_PEER_CERTr}ÚdictÚitemsr{rhr!rrr Z getLoggerror?rrrr6rCÚobjectrDrurr~rrrrÚ+sh             3 S