Your IP : 3.141.4.3


Current Path : /lib64/python2.7/site-packages/M2Crypto/
Upload File :
Current File : //lib64/python2.7/site-packages/M2Crypto/m2urllib.pyo

�

�1Mc@sndZddlZddlZddlZddlTddlZddlZdZddd�Zee	_dS(s�M2Crypto enhancement to Python's urllib for handling 
'https' url's.

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.i����N(t*tsslv23cCs�|dk	r*t|tj�r*||_ntjt�|_d}t|�td�kr�t|�\}}|r�t|�\}}t	|�}n|}n�|\}}t
|�\}}	|	}d}tj|�dkr�d}nIt|	�\}}	|rt|�\}}n|r-d|||	f}n|s?t
d�n|rlddl}
tj|
j|��}nd}tjd|d|j�}|dk	r�|jd	|�|jd
d�|jdd
t|��n|jd|�|r|jdd|�nx!|jD]}
t|j|
�q
W|j�|dk	rQ|j|d�n|j�}|j}tj||jd|�S(Ntthttps	%s://%s%ss
http errors
no host giveni����thosttssl_contexttPOSTsContent-types!application/x-www-form-urlencodedsContent-lengths%dtGETt
AuthorizationsBasic %ss
shttps:(s
http errors
no host given(tNonet
isinstancetSSLtContexttctxtDEFAULT_PROTOCOLttypet	splithostt	splitusertunquotet	splittypetstringtlowertIOErrortbase64tstriptencodestringthttpslibtHTTPSConnectiont
putrequestt	putheadertlent
addheaderstapplyt
endheaderstsendtgetresponsetfpturllibt
addinfourltmsg(tselfturltdataRtuser_passwdRtselectortrealhostturltypetrestRtauththtargstrespR$((s7/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib.pyt
open_httpssV		
	(
t__doc__RtsysR%RRRR	R4t	URLopener(((s7/usr/lib64/python2.7/site-packages/M2Crypto/m2urllib.pyt<module>s$
6