Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.137.166.5
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : test_ssl.pyc
�
@��cc@s�ddlZddlZddlmZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZejd�Zeej�ZejZejj d�Z!e!o]ej"dddfkZ#d	�Z$e$d
�Z%e%j&ej'��Z(e$d�Z)e$d�Z*e)j&ej'��Z+e*j&ej'��Z,e$d
�Z-e$d�Z.dZ/e$d�Z0e0j&ej'��Z1e$dd�Z2e$dd�Z3e$d�Z4e$d�Z5e$d�Z6e$d�Z7e$d�Z8dZ9e$d�Z:e$d�Z;e$d�Z<e$d�Z=e$d�Z>e$d�Z?e$d�Z@e$d �ZAe$d!�ZBeBj&ej'��ZCeDed"d�ZEeDed#d�ZFeDed$d�ZGeDed%d�ZHeDed&d�ZId'�ZJd(ejKfd)��YZLd*�ZMd+�ZNd,�ZOd-�ZPd.�ZQd/�ZRd0�ZSejTejUd1�ZVd2ejKfd3��YZWd4ejKfd5��YZXd6ejKfd7��YZYd8ejKfd9��YZZyddl[Z[Wne\k
rIe]Z^n�Xe_Z^dd:l`maZad;e[jbfd<��YZcd=e[jbfd>��YZdd?e_e]eed@�ZfeedddA�ZgdBejKfdC��YZhe]dD�ZiejdEkr�ei�ndS(Fi����N(ttest_support(tassert_python_ok(tclosingtssltLibreSSLiicGstjjtjjt�|�S(N(tostpathtjointdirnamet__file__(tname((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt	data_file"sskeycert.pemsssl_cert.pemsssl_key.pemskeycert.passwd.pemsssl_key.passwd.pemtsomepasstcapaths
4e1295a3.0s
5ed36f99.0srevocation.crlskeycert3.pemskeycert4.pemspycacert.pemsallsans.pemsself-signed.pythontest.netsselfsigned_pythontestdotnet.pemsnullcert.pemsbadcert.pemsXXXnonexisting.pems
badkey.pems	nokia.pemsnullbytecert.pemstalos-2019-0758.pemsffdh3072.pemtOP_NO_COMPRESSIONtOP_SINGLE_DH_USEtOP_SINGLE_ECDH_USEtOP_CIPHER_SERVER_PREFERENCEtOP_ENABLE_MIDDLEBOX_COMPATcCsBdjtjtj���}tjr>tjj||�ndS(Nt (	Rt	tracebacktformat_exceptiontsystexc_infotsupporttverbosetstdouttwrite(tprefixt
exc_format((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pythandle_errorYs	t
BasicTestscBseZd�ZRS(cCs�ytjtjtj��Wn(tk
rG}|jdkrAqH�nXy tjtjtj�j�Wn(tk
r�}|jdkr�q��nXdS(Ni (Rtsslwrap_simpletsockettAF_INETtIOErrorterrnot_sock(tselfte((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_sslwrap_simpleas (t__name__t
__module__R((((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR_scCs
tjdkS(Nii	ii
i(ii	ii
i(Rt_OPENSSL_API_VERSION(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytcan_clear_optionssscCs
tjdkS(Nii	iii(ii	iii(RtOPENSSL_VERSION_INFO(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytno_sslv2_implies_sslv3_hellowscCs
tjdkS(Nii	ii(ii	iii(RR-(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pythave_verify_flags{scCs.tjr&tj�jdkr&tjStjS(Ni(ttimetdaylightt	localtimettm_isdsttaltzonettimezone(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
utc_offsetscCs{tjdkrwd}tjj||�}|jdd�}|j|�}|ddkrw|d d	|d
}qwn|S(Nii	iis%b %d %H:%M:%S %Y GMTtsecondit0Ri(ii	ii	i(RR+tdatetimetstrptimetreplacetstrftime(t	cert_timetfmttdt((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytasn1time�scs9ttd�r1tj���fd��}|S�SdS(NtPROTOCOL_SSLv2cskytjtj�WnGtjk
r]tjd	kr^tj�d
kr^tjd��q^nX�||�S(Nii	iitdebianssqueeze/sidts'Patched Ubuntu OpenSSL breaks behaviour(ii	iii(RBssqueeze/sidRC(	Rt
SSLContextRAtSSLErrorR-tplatformtlinux_distributiontunittesttSkipTest(targstkwargs(tfunc(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytf�s(thasattrRt	functoolstwraps(RLRM((RLs4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytskip_if_broken_ubuntu_ssl�s	cs"tj���fd��}|S(sySkip a test if the OpenSSL config MinProtocol is > TLSv1.
    OS distros with an /etc/ssl/openssl.cnf and MinProtocol set often do so to
    require TLSv1.2 or higher (Debian Buster).  Some of our tests for older
    protocol versions will fail under such a config.
    Alternative workaround: Run this test in a process with
    OPENSSL_CONF=/dev/null in the environment.
    c	s�tjjdd�}yt|d��j}x`|D]X}tjd|�}|r1|jd�}|dkr�tjd||f��q�q1q1WWdQXWn?t	t
fk
r�}tjr�t
jjd||f�q�nX�||�S(	NtOPENSSL_CONFs/etc/ssl/openssl.cnftrsMinProtocol\s*=\s*(TLSv\d+\S*)itTLSv1s)%s has MinProtocol = %s which is > TLSv1.s(
 Could not scan %s for MinProtocol: %s
(RtenvirontgettopentretmatchtgroupRHRItEnvironmentErrortUnicodeDecodeErrorRRRRR(RJRKtopenssl_cnftconfigtlineRYttls_verterr(RL(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRM�s 
$	(RORP(RLRM((RLs4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt'skip_if_openssl_cnf_minprotocol_gt_tls1�ss SNI support needed for this testtBasicSocketTestscBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
jd��Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zejdejkd�d��Zd�Zejejdkd�d��Zejejdkd�d��Z d�Z!d�Z"d�Z#d�Z$d�Z%eje&�d �d!��Z'd"�Z(e
j)d#d$�d%��Z*RS(&cCs�tjtjtjtjtjtjr6tjntjdkrOtj	n|j
tjtt
h�|j
tjtt
h�tjtjtjtjtjdkr�tjtjndS(Nii(ii(iii(Rt	CERT_NONEt
CERT_OPTIONALt
CERT_REQUIREDRRtHAS_ECDHRR-RtassertIntHAS_SNItTruetFalsetOP_NO_SSLv2tOP_NO_SSLv3tOP_NO_TLSv1t
OP_NO_TLSv1_3t
OP_NO_TLSv1_1t
OP_NO_TLSv1_2(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_constants�s$	

cCs�tj�}tjr>tjjd||r0dp3df�nttd�r|jt	tj
d�|jt	tj
dd�ntjdd�dS(	Ns
 RAND_status is %d (%s)
ssufficient randomnesssinsufficient randomnesstRAND_egditfoosthis is a random stringg�R@(RtRAND_statusRRRRRRNtassertRaisest	TypeErrorRstRAND_add(R&tv((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_random�s	cCsttjjt�}tjr?tjjdt	j
|�d�n|j|dddd!d#f�|j|dtd��|j|d
td��|j|dd�|j|dd%d'd)d+f�|j|dd-�tjjt
�}tjrtjjdt	j
|�d�n|j|dd.d/f�|j|dd0�|j|dd1�|j|dd2�dS(3Ns
tissuertcountryNametXYtlocalityNamesCastle AnthraxtorganizationNamesPython Software Foundationt
commonNamet	localhosttnotAftersAug 26 14:23:15 2028 GMTt	notBeforesAug 29 14:23:15 2018 GMTtserialNumbert98A7CF88C74A32EDtsubjecttsubjectAltNametDNSsprojects.developer.nokia.comsprojects.forum.nokia.comtOCSPshttp://ocsp.verisign.comt	caIssuerss0http://SVRIntl-G3-aia.verisign.com/SVRIntlG3.certcrlDistributionPointss0http://SVRIntl-G3-crl.verisign.com/SVRIntlG3.crl(R|R}((R|R}(R~sCastle Anthrax((R~sCastle Anthrax(RsPython Software Foundation((RsPython Software Foundation(R�R�((R�R�(R|R}((R|R}(R~sCastle Anthrax((R~sCastle Anthrax(RsPython Software Foundation((RsPython Software Foundation(R�R�((R�R�(R�R�((R�R�(R�sprojects.developer.nokia.com(R�sprojects.forum.nokia.com(shttp://ocsp.verisign.com(s0http://SVRIntl-G3-aia.verisign.com/SVRIntlG3.cer(s0http://SVRIntl-G3-crl.verisign.com/SVRIntlG3.crl(Rt_sslt_test_decode_certtCERTFILERRRRRtpprinttpformattassertEqualR@t	NOKIACERT(R&tp((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_parse_cert�s8	$



	$



cCs�tjjt�}tjr?tjjdt	j
|�d�n|j|iddfd6dd6d	d
6dd6ddfd6dd6dd6�dS(Ns
R|tUKR�scody-caR{sJun 14 18:00:58 2028 GMTR�sJun 18 18:00:58 2018 GMTR�t02R�s#codenomicon-vm-2.test.lal.cisco.comR�R�R�itversion(R|R�((R|R�(R�scody-ca((R�scody-ca(R|R�((R|R�(R�s#codenomicon-vm-2.test.lal.cisco.com((R�s#codenomicon-vm-2.test.lal.cisco.com(R�s#codenomicon-vm-2.test.lal.cisco.com((R�s#codenomicon-vm-2.test.lal.cisco.com(RR�R�tTALOS_INVALID_CRLDPRRRRRR�R�R�(R&R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_parse_cert_CVE_2019_5010
s	$

cCs�tjjt�}tjr?tjjdt	j
|�d�nd!d#d%d'd)d+d-f}|j|d|�|j|d|�tjd.kr�d/d0d1d2d3f}nd4d5d6d7d8f}|j|d|�dS(9Ns
R|tUStstateOrProvinceNametOregonR~t	BeavertonRsPython Software FoundationtorganizationalUnitNamesPython Core DevelopmentR�snull.python.orgexample.orgtemailAddressspython-dev@python.orgR�R{ii	iR�saltnull.python.orgexample.comtemails null@python.orguser@example.orgtURIs)http://null.python.orghttp://example.orgs
IP Addresss	192.0.2.1s2001:DB8:0:0:0:0:0:1
s	<invalid>R�(R|R�((R|R�(R�R�((R�R�(R~R�((R~R�(RsPython Software Foundation((RsPython Software Foundation(R�sPython Core Development((R�sPython Core Development(R�snull.python.orgexample.org((R�snull.python.orgexample.org(R�spython-dev@python.org((R�spython-dev@python.org(ii	i(R�saltnull.python.orgexample.com(R�s null@python.orguser@example.org(R�s)http://null.python.orghttp://example.org(s
IP Addresss	192.0.2.1(s
IP Addresss2001:DB8:0:0:0:0:0:1
(R�saltnull.python.orgexample.com(R�s null@python.orguser@example.org(R�s)http://null.python.orghttp://example.org(s
IP Addresss	192.0.2.1(s
IP Addresss	<invalid>(
RR�R�tNULLBYTECERTRRRRRR�R�R�R+(R&R�R�tsan((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_parse_cert_CVE_2013_4238"s0	$		c
CsZtjjt�}|j|ddddddd	dd!d#d%ffd&d'd(d)f
�dS(*NR�R�tallsanst	othernames
<unsupported>R�suser@example.orgswww.example.orgtDirNameR|R}R~sCastle AnthraxRsPython Software FoundationR�sdirname exampleR�shttps://www.python.org/s
IP Addresss	127.0.0.1s0:0:0:0:0:0:0:1
s
Registered IDs	1.2.3.4.5(R�R�(R�s
<unsupported>(R�s
<unsupported>(R�suser@example.org(R�swww.example.org(R|R}((R|R}(R~sCastle Anthrax((R~sCastle Anthrax(RsPython Software Foundation((RsPython Software Foundation(R�sdirname example((R�sdirname example(R�shttps://www.python.org/(s
IP Addresss	127.0.0.1(s
IP Addresss0:0:0:0:0:0:0:1
(s
Registered IDs	1.2.3.4.5(RR�R�t
ALLSANFILER�(R&R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_parse_all_sans?s 
	cCs�ttd��}|j�}WdQXtj|�}tj|�}tj|�}|j||�|jtjd�s�|j	d|�n|j
dtjd�s�|j	d|�ndS(NRSs
s-DER-to-PEM didn't include correct header:
%r
s-DER-to-PEM didn't include correct footer:
%r
(RWt
CAFILE_CACERTtreadRtPEM_cert_to_DER_certtDER_cert_to_PEM_certR�t
startswitht
PEM_HEADERtfailtendswitht
PEM_FOOTER(R&RMtpemtd1tp2td2((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_DER_to_PEMTsc	Cs�tj}tj}tj}|j|ttf�|j|t�|j|t�|j	|d�|j
|d�|\}}}}}|j	|d�|j
|d�|j	|d�|j
|d�|j	|d�|j
|d�|j	|d�|j|d�|j	|d�|j|d�tr`|j
|jdj|��||t|�f�n.|j
|jd	j|||��||f�dS(
Ni�i0iiii?is
LibreSSL {:d}sOpenSSL {:d}.{:d}.{:d}(RtOPENSSL_VERSION_NUMBERR-tOPENSSL_VERSIONtassertIsInstancetinttlongttupletstrtassertGreaterEqualt
assertLesstassertLessEqualtIS_LIBRESSLt
assertTrueR�tformatthex(	R&tntttstmajortminortfixtpatchtstatus((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_openssl_version`s0			!cCsJtjtj�}tj|�}tj|�}~|j|�d�dS(N(R!R"Rtwrap_sockettweakreftrefR�tNone(R&R�tsstwr((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
test_refcycles
c
Cs�tjtj�}ttj|����}|jtj|jd�|jtj|jt	d��|jtj|j
d�|jtj|jt	d�d�|jtj|jd�|jtj|j
dd�|jt|j�WdQXdS(Nitxs0.0.0.0i(s0.0.0.0i(R!R"RRR�Rvterrortrecvt	recv_intot	bytearraytrecvfromt
recvfrom_intotsendtsendtotNotImplementedErrortdup(R&R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_wrapped_unconnected�s"cCshxadD]Y}tjtj�}|j|�ttj|���}|j||j��WdQXqWdS(Ngg@(Ngg@(	R�R!R"t
settimeoutRRR�R�t
gettimeout(R&ttimeoutR�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_timeout�s


cCs�tj�}|jtdtj|dt�|jtdtj|dt�|jtdtj|dtdd�ttj|dtdt���&}|jtd|jt	df�WdQX|j
t��5}ttj���}tj|dt�WdQXWdQX|j
|jjtj�|j
t��;}ttj��� }tj|dtdt�WdQXWdQX|j
|jjtj�|j
t��;}ttj��� }tj|dtdt�WdQXWdQX|j
|jjtj�dS(	Nscertfile must be specifiedtkeyfiles5certfile must be specified for server-side operationstserver_sidetcertfileRCs!can't connect in server-side modei�(R!tassertRaisesRegexpt
ValueErrorRR�R�RjRtconnecttHOSTRvR#tNONEXISTINGCERTR�t	exceptionR$tENOENT(R&tsockR�tcm((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_errors�s6			$c
Cstjjtjjt�p!tj|�}tj�}|j|j�|j	t
j��!t
j|d|dt
j
�WdQXdS(s;Check that trying to use the given client certificate failsR�tssl_versionN(RRRRR	tcurdirR!t
addCleanuptcloseRvRRER�tPROTOCOL_TLSv1(R&R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
bad_cert_test�s!	cCs|jd�dS(s Wrapping with an empty cert filesnullcert.pemN(R�(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_empty_cert�scCs|jd�dS(s:Wrapping with a badly formatted certificate (syntax error)sbadcert.pemN(R�(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_malformed_cert�scCs|jd�dS(s2Wrapping with a badly formatted key (syntax error)s
badkey.pemN(R�(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_malformed_key�scs�d�}�fd�}idEd6}||d�||d�||d�||d�||d	�||d
�idHd6}||d�||d
�||d�||d�||d�idKd6}||d�||d�||d�||d�||d�idNd6}||d�||d	�||d�idQd6}||d
�||d�||d�||d�idTd6}||d�||d�||d�djd�jd�}id|fffd6}|||�idWd6}|||�idZd6}|||�d!jd�jd�}id|fffd6}||d"jd�jd��||d#jd�jd��||d$jd�jd��||d%jd�jd��id&d'6d]d6d^d_d`fd.6}||d*�||d+�||d-�||d(�id/d'6dbdddfdhdjfd6}||d8�||d9�||d3�id/d'6dldndpdrfd6}||d8�id:d'6dtdvdxdzfd6d|d.6}||d8�id:d'6d~d�d�d�fd6d�d.6}||d<��jttjdd��jttjid�id�d6}||d>�id�d6}||d>�id�d6}�jtj��}tj|dA�WdQX�jdBt	|j
��dS(�NcSstj||�dS(N(Rtmatch_hostname(tcertthostname((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytok�scs �jtjtj||�dS(N(RvRtCertificateErrorR�(R�R�(R&(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR��sR�sexample.comR�sExAmple.cOmswww.example.coms.example.comsexample.orgtexampleXcoms*.a.coms	foo.a.coms
bar.foo.a.comsa.comsXa.coms.a.comsf*.comsfoo.comsf.comsbar.comsbar.foo.comsnull.python.orgexample.orgsnull.python.orgs	*.*.a.comsa.*.coms	a.foo.comsa..comupüthon.python.orgtidnatasciis
x*.python.orgsxn--p*.python.orguwww*.pythön.orguwww.pythön.orguwww1.pythön.orguftp.pythön.orgupythön.orgsJun 26 21:41:46 2011 GMTR�slinuxfrz.orgR�slinuxfr.orgslinuxfr.comR�s
<unsupported>R�sDec 18 23:59:59 2011 GMTR|R�R�t
CaliforniaR~s
Mountain ViewRs
Google Incsmail.google.coms	gmail.comsDec 18 23:59:59 2099 GMTtblablas
google.comsa*b.comsaxxb.comsa*b.co*sa*b*.comsaxxbxxc.comstoo many wildcards(R�sexample.com((R�sexample.com(((R�sexample.com(R�s*.a.com((R�s*.a.com(((R�s*.a.com(R�sf*.com((R�sf*.com(((R�sf*.com(R�snull.python.orgexample.org((R�snull.python.orgexample.org(((R�snull.python.orgexample.org(R�s	*.*.a.com((R�s	*.*.a.com(((R�s	*.*.a.com(R�sa.*.com((R�sa.*.com(((R�sa.*.com(R�s
x*.python.org((R�s
x*.python.org(((R�s
x*.python.org(R�sxn--p*.python.org((R�sxn--p*.python.org(((R�sxn--p*.python.org(R�slinuxfrz.org((R�slinuxfrz.org(((R�slinuxfrz.org(R�slinuxfr.org(R�slinuxfr.com(R�s
<unsupported>(R|R�((R|R�(R�R((R�R(R~s
Mountain View((R~s
Mountain View(Rs
Google Inc((Rs
Google Inc(R�smail.google.com((R�smail.google.com(R|R�((R|R�(R�R((R�R(R~s
Mountain View((R~s
Mountain View(Rs
Google Inc((Rs
Google Inc(R|R�((R|R�(R�R((R�R(R~s
Mountain View((R~s
Mountain View(R�smail.google.com((R�smail.google.com(R�R((R�R(R|R�((R|R�(R�R((R�R(R~s
Mountain View((R~s
Mountain View(Rs
Google Inc((Rs
Google Inc(R�R((R�R(R�sa*b.com((R�sa*b.com(((R�sa*b.com(R�sa*b.co*((R�sa*b.co*(((R�sa*b.co*(R�sa*b*.com((R�sa*b*.com(((R�sa*b*.com(tencodetdecodeRvR�RR�R�RRhR�R�(R&R�R�R�RR�((R&s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_match_hostname�s�	































































cCsPtjtj�}ttj���&}|jt|j|tdd�WdQXdS(Ntserver_hostnames
some.hostname(	RRDtPROTOCOL_SSLv23RR!RvR�R�Rj(R&tctxR�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_server_sideXsc
CsWtjtj�}ttj|���*}|jt��|jd�WdQXWdQXdS(Nsunknown-type(R!R"RRR�RvR�tget_channel_binding(R&R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_unknown_channel_binding_ss
tls-uniques*'tls-unique' channel binding not availablecCs�tjtj�}ttj|���}|j|jd��WdQXtjtj�}ttj|dtdt���}|j|jd��WdQXdS(Ns
tls-uniqueR�R�(	R!R"RRR�tassertIsNoneR
RjR�(R&R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_tls_unique_channel_bindingfs$cCs�tj�}|jt|�d�|j|tj�tj��M}t|d<t	|d<tj�}|j|j
t	�|j|jt�WdQXdS(NitSSL_CERT_DIRt
SSL_CERT_FILE(Rtget_default_verify_pathsR�tlenR�tDefaultVerifyPathsRtEnvironmentVarGuardtCAPATHR�tcafileR
(R&tpathstenv((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_get_default_verify_pathsrs

twin32sWindows specificc	CsI|jtjd��|jtjd��|jttj�|jttjd�t�}x�dD]�}tj|�}|j|t�x�|D]�}|j|t	�|j
t|�d�|\}}}|j|t�|j
|ddh�|j|ttf�t|t�r�|j|�q�q�WqeWd}|j
||�dS(	NtCAtROOTRCitx509_asnt
pkcs_7_asns1.3.6.1.5.5.7.3.1(RR(R�Rtenum_certificatesRvRwtWindowsErrortsetR�tlistR�R�RtbytesRhtboolt
isinstancetupdate(	R&t
trust_oidst	storenametstoretelementR�tencttrustt
serverAuth((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_enum_certificates~s&	

cCs�|jtjd��|jttj�|jttjd�tjd�}|j|t�xb|D]Z}|j|t�|j	t
|�d�|j|dt�|j|dddh�qeWdS(NRRCiiiRR (
R�Rt	enum_crlsRvRwR"R�R$R�R�RR%Rh(R&tcrlsR,((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_enum_crls�s
cCsDd}tjd�}|j||�|j|jd�|j|jd�|j|jd�|j|jd�|j|tj�|jt	tjd�tjj
d�}|j||�|j|tj�|jt	tjj
d�|jt	d��tjj
d�WdQXx�td�D]�}ytjj
|�}Wnt	k
rMqX|j|jt
�|j|jt�|j|jt�|j|jttd�f�qWtjjd�}|j||�|j|tj�|jtjjd�|�|jtjjd�|�|jt	d	��tjjd
�WdQXdS(Ni�R/sTLS Web Server Authentications1.3.6.1.5.5.7.3.1i����sunknown NID 100000i��i�sunknown object 'serverauth't
serverauth(i�R/sTLS Web Server Authentications1.3.6.1.5.5.7.3.1(Rt_ASN1ObjectR�tnidt	shortnametlongnametoidR�RvR�tfromnidR�trangeR�R�ttypeR�tfromname(R&texpectedtvaltitobj((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_asn1object�sB
#cCstjd�}|jtjjtj�|jtjj|�|jtjjjd�|jtjjjd�|jtjjjd�tjd�}|jtjj	tj�|jtjj	|�|jtjj	jd�|jtjj	jd�|jtjj	jd�dS(Ns1.3.6.1.5.5.7.3.1i�R/s1.3.6.1.5.5.7.3.2i�t
clientAuth(
RR5R�tPurposetSERVER_AUTHR�R6R7R9tCLIENT_AUTH(R&R?((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_purpose_enum�scCs�tjtjtj�}|j|j�|jt��}tj|dtj	�WdQX|j
t|j�d�tj
tj�}|jt��}|j|�WdQX|j
t|j�d�dS(Nt	cert_reqss!only stream sockets are supported(R!R"t
SOCK_DGRAMR�R�RvR�RR�RdR�R�R�RDR
(R&R�tcxR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_unsupported_dtls�scCs|jtj|�|�dS(N(R�Rtcert_time_to_seconds(R&t
timestringt	timestamp((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytcert_time_ok�scCs'|jt��tj|�WdQXdS(N(RvR�RRL(R&RM((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytcert_time_fail�ss)local time needs to be different from UTCcCs$|jdd�|jdd�dS(NsMay  9 00:00:00 2007 GMTg�C��AsJan  5 09:34:43 2018 GMTg��ѓ�A(RO(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt"test_cert_time_to_seconds_timezone�scCs*d}d}|j||�|jtjd|�|�|jd|�|jd|�|jd�|jd�|jd�|jd	�|jd
�|jd�|jd�d
}|jd|�|jd|�|jdd�|jdd�|jdd�|jd�|jdd�dS(NsJan  5 09:34:43 2018 GMTg��ѓ�AR=sJan 05 09:34:43 2018 GMTsJaN  5 09:34:43 2018 GmTsJan  5 09:34 2018 GMTsJan  5 09:34:43 2018sJan  5 09:34:43 2018 UTCsJan 35 09:34:43 2018 GMTsJon  5 09:34:43 2018 GMTsJan  5 24:00:00 2018 GMTsJan  5 09:60:43 2018 GMTg�W�AsDec 31 23:59:60 2008 GMTsJan  1 00:00:00 2009 GMTsJan  5 09:34:59 2018 GMTi�FOZsJan  5 09:34:60 2018 GMTi�FOZsJan  5 09:34:61 2018 GMTi�FOZsJan  5 09:34:62 2018 GMTsDec 31 23:59:59 9999 GMTg�� �MB(ROR�RRLRP(R&RMttst
newyear_ts((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_cert_time_to_seconds�s*







tLC_ALLRCcCsVd�}|�j�dkr.|jd�n|jdd�|j|�d�dS(NcSstjdd	�S(
Ns%biiiiiii(	iiiiiiiii(R0R<(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytlocal_february_namestfebs>locale-specific month name needs to be different from C localesFeb  9 00:00:00 2007 GMTg`�r�As  9 00:00:00 2007 GMT(tlowertskipTestRORP(R&RV((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt test_cert_time_to_seconds_locales
	(+R)R*RrRzR�R�R�R�R�R�Rtcpython_onlyR�R�R�R�R�R�R�R�RRRRHt
skipUnlessRtCHANNEL_BINDING_TYPESRRRRFR0R3RBRGRKRORPR6RQRTtrun_with_localeRZ(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRc�sB			(					
	
								�			$$	'					#tContextTestscBs�eZed��Zed��Zd�Zed��Zd�Zej	e
�d�d��Zd�Zd�Z
d	�Zd
�Zed��Zd�Zej	ejd
�d��Zed��Zed��Zd�Zd�Zd�Zejejdkd�ejed�d���Zej	ejdkd�d��Z d�Z!d�Z"d�Z#d�Z$d�Z%d�Z&RS( cCsaxtD]}tj|�qW|jttj�|jttjd�|jttjd�dS(Ni����i*(t	PROTOCOLSRRDRvRwR�(R&tprotocol((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_constructor-s

cCs7x0tD](}tj|�}|j|j|�qWdS(N(R`RRDR�Ra(R&tprotoR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
test_protocol5s
cCsYtjtj�}|jd�|jd�|jtjd��|jd�WdQXdS(NtALLtDEFAULTsNo cipher can be selecteds^$:,;?*'dorothyx(RRDR�tset_ciphersR�RE(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_ciphers;s


cCs�tjtj�}tjtjBtjB}|ttBtBt	Bt
BO}|j||j�|jtj
O_|j|tj
B|j�t�r�|jtj
@|_|j||j�d|_|jd|jtj@�n|jt��d|_WdQXdS(Ni(RRDR�tOP_ALLRlRmRRRRRR�toptionsRnR,RvR�(R&Rtdefault((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_optionsBs		cCs�tjtj�}|j|jtj�tj|_|j|jtj�tj|_|j|jtj�tj|_|j|jtj�|jt	��d|_WdQX|jt��d|_WdQXdS(Ni*(RRDR�R�tverify_modeRdReRfRvRwR�R�(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_verify_modeXss!verify_flags need OpenSSL > 0.9.8cCs�tjtj�}ttdd�}|j|jtj|B�tj|_|j|jtj�tj|_|j|jtj�tj|_|j|jtj�tjtj	B|_|j|jtjtj	B�|j
t��d|_WdQXdS(NtVERIFY_X509_TRUSTED_FIRSTi(
RRDR�tgetattrR�tverify_flagstVERIFY_DEFAULTtVERIFY_CRL_CHECK_LEAFtVERIFY_CRL_CHECK_CHAINtVERIFY_X509_STRICTRvRwR�(R&Rttf((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_verify_flagsgscCs�tjtj�}|jtdd�|jtdt�|jt|jdt�|jt��}|jt	�WdQX|j
|jjtj
�|jtjd��|jt�WdQX|jtjd��|jt�WdQXtjtj�}|jtt�|jdtdt�|jdtdt�|jtjd��|jt�WdQX|jtjd��|jt�WdQX|jtjd��|jdtdt�WdQXtjtj�}|jtjd��|jtt�WdQX|jtdt�|jtdtj��|jtdttj���|jttt�|jtttj��|jttttj���|jtd��|jtdt�WdQX|jtj��|jtdd�WdQX|jtd��|jtdd	d
�WdQXd�}d�}d
�}d�}d�}d�}d�}	ddd��Y}
|jtd|�|jtd|�|jtd|�|jtd|
��|jtd|
�j�|jtj��|jtd|�WdQX|jtd��|jtd|�WdQX|jtd��|jtd|�WdQX|jtd��|jtd|	�WdQX|jtd|	�dS(NR�sPEM libR�skey values mismatchtpasswordsshould be a stringtbadpassscannot be longertai�cSstS(N(tKEY_PASSWORD(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytgetpass_unicode�scSs
tj�S(N(R{R(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
getpass_bytes�scSsttj��S(N(R�R{R(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytgetpass_bytearray�scSsdS(NRy((((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytgetpass_badpass�scSsddS(NRzii((((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytgetpass_huge�scSsdS(Ni	((((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytgetpass_bad_type�scSstd��dS(Ns
getpass error(t	Exception(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytgetpass_exception�stGetPassCallablecBseZd�Zd�ZRS(cSstS(N(R{(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt__call__�scSstS(N(R{(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytgetpass�s(R)R*R�R�(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR��s	smust return a strings
getpass error(( RRDR�tload_cert_chainR�R�RvRwR#R�R�R�R$R�R�REtBADCERTt	EMPTYCERTtONLYCERTtONLYKEYtBYTES_ONLYCERTt
BYTES_ONLYKEYR�tCERTFILE_PROTECTEDR{RR�tONLYKEY_PROTECTEDRjR�R�R�(R&RR�R|R}R~RR�R�R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_load_cert_chain{sz							
cCsjtjtj�}|jt�|jdtdd�|jt�|jdtdd�|jdtjd��|jt	|j�|jt	|jddd�|jt
��}|jt�WdQX|j|j
jtj�|jt
��|jd�WdQX|jtjd��|jt�WdQX|jtt�|jtdt�|jt	|jdt�dS(NRR
sutf-8usPEM lib(RRDR�tload_verify_locationsR�R�tBYTES_CERTFILERRvRwR#R�R�R�R$R�R�RER�RtBYTES_CAPATHRj(R&RR�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_load_verify_locations�s$

c
Cstt��}|j�jd�}WdQXtj|�}tt��}|j�jd�}WdQXtj|�}tjtj�}|j	|j
�dd�|jd|�|j	|j
�dd�|jd|�|j	|j
�dd�|jd|�|j	|j
�dd�tjtj�}dj||f�}|jd|�|j	|j
�dd�tjtj�}d|d	|d
|dg}|jddj|��|j	|j
�dd�tjtj�}|jd|�|jd|�|j	|j
�dd�|jd|�|j	|j
�dd�tjtj�}dj||f�}|jd|�|j	|j
�dd�tjtj�}|j
t|jdt�|jtjd
��|jdd�WdQX|jtjd��|jdd�WdQXdS(NRtx509_caitcadataiis
theadtothertagainttailRCs
no start lineubrokensnot enough datatbroken(RWR�R�RRR�tCAFILE_NEURONIORDR�R�tcert_store_statsR�RRvRwtobjectR�RE(R&RMt
cacert_pemt
cacert_dertneuronio_pemtneuronio_derRtcombined((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_load_verify_cadata�sNc	Csfd}tj�}y|j|�Wn(tk
rM|jd||f�nXtjtj�}|jt	�t
jdkr�|jt�n|j
t|j�|j
t|jd�|j
t��}|jt�WdQX|j|jjtj�|j
tj��}|jt�WdQXtj��9}t
jj||�}tjt	|�|j|�WdQXdS(Nu
dhpäräm.pems;filename %r cannot be encoded to the filesystem encoding %rtnt(RtgetfilesystemencodingRtUnicodeEncodeErrorRYRRDR�tload_dh_paramstDHFILERR
tBYTES_DHFILERvRwR�R#R�R�R�R$R�RER�Rttemp_dirRRtshutiltcopy(R&tfilenametfs_encodingRR�tdtfname((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_load_dh_paramss*

cCs�x�tD]x}tj|�}|j|j�idd6dd6dd6dd6dd6dd6dd6dd	6dd
6dd6dd6�qWdS(
NitnumberR�tconnect_goodtconnect_renegotiatetaccepttaccept_goodtaccept_renegotiatethitstmissesttimeoutst
cache_full(R`RRDR�t
session_stats(R&RcR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_session_stats6s
cCs tjtj�}|j�dS(N(RRDR�tset_default_verify_paths(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_set_default_verify_pathsHss#ECDH disabled on this OpenSSL buildcCs�tjtj�}|jd�|jd�|jt|j�|jt|jd�|jt|jd�|jt|jd�dS(Nt
prime256v1Rt(RRDR�tset_ecdh_curveRvRwR�R�(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_set_ecdh_curveNs

cCs�tjtj�}|jt|j�|jt|jd�|jt|jd�|jt|j|�d�}|jd�|j|�dS(NiRCcSsdS(N((R�t
servernameR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
dummycallbackbs(RRDR�RvRwtset_servername_callbackR�(R&RR�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_sni_callbackXs	
cCsatjtj�}|d�}|j|�tj|�}~~tj�|j|�d�dS(NcSsdS(N((R�R�Rtcycle((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�ls(
RRDR�R�R�R�tgctcollecttassertIsR�(R&RR�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_sni_callback_refcyclegs

cCs�tjtj�}|j|j�idd6dd6dd6�|jt�|j|j�idd6dd6dd6�|jt�|j|j�idd6dd6dd6�|jt�|j|j�idd6dd6dd6�dS(NiR�tcrltx509ii(	RRDR�R�R�R�R�R�R�(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_cert_store_statsts


cCstjtj�}|j|j�g�|jt�|j|j�g�|jt�|j|j�iddddfd	6td
�d6td�d
6dd6dd6dd!d#d%fd6dd6g�t	t��}|j
�}WdQXtj|�}|j|jt�|g�dS(&NRsRoot CAR�shttp://www.cacert.orgR�sCA Cert Signing AuthorityR�ssupport@cacert.orgR{sMar 29 12:29:49 2033 GMTR�sMar 30 12:29:49 2003 GMTR�t00R�s!https://www.cacert.org/revoke.crlR�R�iR�(RsRoot CA((RsRoot CA(R�shttp://www.cacert.org((R�shttp://www.cacert.org(R�sCA Cert Signing Authority((R�sCA Cert Signing Authority(R�ssupport@cacert.org((R�ssupport@cacert.org(s!https://www.cacert.org/revoke.crl(RsRoot CA((RsRoot CA(R�shttp://www.cacert.org((R�shttp://www.cacert.org(R�sCA Cert Signing Authority((R�sCA Cert Signing Authority(R�ssupport@cacert.org((R�ssupport@cacert.org(
RRDR�R�tget_ca_certsR�R�R�R@RWR�R�Rj(R&RRMR�tder((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_get_ca_certs�s.





cCs�tjtj�}|j�tjtj�}|jtjj�|j�tjtj�}|jtjj�tjtj�}|jt|jd�|jt|jd�dS(NRE(
RRDR�tload_default_certsRDRERFRvRwR�(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_load_default_certs�s

Rsnot-Windows specifics!LibreSSL doesn't support env varsc	Csttjtj�}tj��P}t|d<t|d<|j�|j|j	�idd6dd6dd6�WdQXdS(NRRiR�iR�R�(
RRDR�RRRR�R�R�R�(R&RR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_load_default_certs_env�s


sWindows specificcCs�tjtj�}|j�|j�}tjtj�}tj��K}t|d<t|d<|j�|dcd7<|j	|j�|�WdQXdS(NRRR�i(
RRDR�R�R�RRRR�R�(R&RtstatsR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt#test_load_default_certs_env_windows�s



cCs�|j|jtj@tj�tdkrC|j|jt@t�ntdkri|j|jt@t�ntdkr�|j|jt@t�ntdkr�|j|jt@t�ndS(Ni(R�RjRRlRRRR(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt_assert_context_options�s


cCs(tj�}|j|jtj�|j|jtj�|j|j�|j	|�t
t��}|j�j
d�}WdQXtjdtdtd|�}|j|jtj�|j|jtj�|j	|�tjtjj�}|j|jtj�|j|jtj�|j	|�dS(NRRR
R�(Rtcreate_default_contextR�RaR
RmRfR�tcheck_hostnameR�RWt
SIGNING_CAR�RRRDRFRd(R&RRMR�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_create_default_context�s 
	
cCs_tj�}|j|jtj�|j|jtj�|j|j�|j	|�tjtj
�}|j|jtj
�|j|jtj�|j	|�tjtj
dtjdt�}|j|jtj
�|j|jtj�|j
|j�|j	|�tjdtjj�}|j|jtj�|j|jtj�|j	|�dS(NRHR�tpurpose(Rt_create_stdlib_contextR�RaR
RmRdtassertFalseR�R�R�RfRjR�RDRF(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest__create_stdlib_context�s(

		
cCs�tjd�}|j|j|j�|jdt�|j|j|j�|jdt�|j|j|j�|jdt�|j�|j|j|j�dS(NRtenable(	Rtimport_fresh_moduleR�t_create_default_https_contextR�t_https_verify_certificatesRkt_create_unverified_contextRj(R&t	local_ssl((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest__https_verify_certificatess



cCsqd}d}i}td||�d|tj<td||�x+d	D]#}||tj<td||�qFWdS(
Nsimport ssl, sys;             status = "Error: _create_default_https_context does not verify certs"                        if ssl._create_default_https_context is                           ssl._create_unverified_context                      else None;             sys.exit(status)simport ssl, sys;             status = "Error: _create_default_https_context verifies certs"                        if ssl._create_default_https_context is                           ssl.create_default_context                      else None;             sys.exit(status)s-cR8RCt1tenabledRt(RCR�R�Rt(RRt_https_verify_envvar(R&thttps_is_verifiedthttps_is_not_verifiedt	extra_envtsetting((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest__https_verify_envvars


cCs�tjtj�}|j|j�|jt��t|_WdQXtj|_	|j|j�t|_|j
|j�tj|_	t|_|j
|j�|jt��tj|_	WdQXt
|_|j|j�dS(N(RRDR�R�R�RvR�RjRfRmR�ReRdRk(R&R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_check_hostname6s			('R)R*RQRbRdRhRlRnRHR\R/RwR�R�R�R�R�R�RRgR�t	needs_sniR�R�R�R�R�tskipIfRRFR�R�R�R�R�R�R�R�R�(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR_+s8			S		:		

				$					t
SSLErrorTestscBs#eZd�Zd�Zd�ZRS(cCsztjdd�}|jt|�d�|j|jd�tjdd�}|jt|�d�|j|jd�dS(NiRt(RRER�R�R$tSSLZeroReturnError(R&R'((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_strOscCs�tjtj�}|jtj��}|jt�WdQX|j|jj	d�|j|jj
d�t|j�}|j|j
d�|�dS(NtPEMt
NO_START_LINEs"[PEM: NO_START_LINE] no start line(RRDR�RvRER�R�R�R�tlibrarytreasonR�R�R�(R&RR�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_lib_reasonYsc
Cstjtj�}ttj����}|jd�|jd�tj�}|j|j��|j	t
�t|j|t
dt
���m}|jtj
��}|j�WdQXt|j�}|j|jd�|�|j|jjtj�WdQXWdQXdS(Ns	127.0.0.1iitdo_handshake_on_connects%The operation did not complete (read)(s	127.0.0.1i(RRDR�RR!tbindtlistenR�tgetsocknametsetblockingRkR�RvtSSLWantReadErrortdo_handshakeR�R�R�R�R�R$tSSL_ERROR_WANT_READ(R&RR�tcR�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
test_subclasscs


!(R)R*R�R�R(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�Ms	
	
tNetworkedTestscBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
jej
dkd	�d
��Zd�Zd�Zd
�Zd�Zed��ZRS(c
Cs+tjt��tjtjtj�dtj�}z-|jtdf�|j	i|j
��Wd|j�Xtjtjtj�dtj�}|j
tjd|jtdf�|j�tjtjtj�dtjdt�}z*|jtdf�|j|j
��Wd|j�XWdQXdS(NRHi�scertificate verify failedtca_certs(Rttransient_internettREMOTE_HOSTRR�R!R"RdR�R�tgetpeercertR�RfR�REtREMOTE_ROOT_CERTR�(R&R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_connectxs&
		c
Cs�tjt��stjtjtj�dtjdt�}z6|j	d|j
tdf��|j|j��Wd|j
�XWdQXdS(NRHRii�(RRR	RR�R!R"RfRR�t
connect_exR�R
R�(R&R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_connect_ex�s		cCsAtjt��,tjtjtj�dtjdtdt	�}z�|j
t	�|jtdf�}|j|dt
jt
jf�tjg|ggd�xutry|j�PWq�tjk
r�tj|gggd�q�tjk
rtjg|ggd�q�Xq�W|j|j��Wd|j�XWdQXdS(NRHRR�i�ig@(RRR	RR�R!R"RfRRkRR
RhR$tEINPROGRESStEWOULDBLOCKtselectRjRRtSSLWantWriteErrorR�R
R�(R&R�trc((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_non_blocking_connect_ex�s(		
	
!cCs�tjt���tjtjtj�dtjdtdt	�}z^|j
d�|jtdf�}|dkr�|jd�n|j
|tjtjf�Wd|j�XWdQXdS(NRHRR�gH�����z>i�is!REMOTE_HOST responded too quickly(RRR	RR�R!R"RfRRkR�R
RYRhR$tEAGAINRR�(R&R�R((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_timeout_connect_ex�s		
 c
Cs�tjt���tjtjtj�dtjdt�}zG|j	tdf�}t
jt
jt
j
t
jf}|j||�Wd|j�XWdQXdS(NRHRi�(RRR	RR�R!R"RfRR
R$tECONNREFUSEDtEHOSTUNREACHt	ETIMEDOUTRRhR�(R&R�Rterrors((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_connect_ex_error�s		c
Csytjt��dtjtj�}|jtjtj��}|j	tdf�z|j
i|j��Wd|j�X|jtjtj�dt�}|j	tdf�|j�tj
|_|jtjtj��}|jtjd|j	tdf�|j�|jt�|jtjtj��}|j	tdf�z|j�}|j|�Wd|j�XWdQXdS(Ni�R	scertificate verify failed(RRR	RRDR
R�R!R"R�R�R
R�RfRmR�RER�RR�(R&RR�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_connect_with_context�s.	


cCs(tjt��tjtj�}tj|_|jdt	�|j
tjtj��}|j
tdf�z|j�}|j|�Wd|j�Xtjtj�}tj|_|jdt�|j
tjtj��}|j
tdf�z|j�}|j|�Wd|j�XWdQXdS(NR
i�(RRR	RRDR
RfRmR�RR�R!R"R�R
R�R�R�(R&RR�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_connect_capath�s&c
Cs[tt��}|j�jd�}WdQXtj|�}tjt��
tj	tj
�}tj|_|j
d|�t|jtjtj����3}|jtdf�|j�}|j|�WdQXtj	tj
�}tj|_|j
d|�t|jtjtj����3}|jtdf�|j�}|j|�WdQXWdQXdS(NRR�i�(RWRR�RRR�RRR	RDR
RfRmR�RR�R!R"R�R
R�(R&RMR�R�RR�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_connect_cadatas$$$R�s*Can't use a socket as a file under WindowscCs�tjt���tjtjtj��}|jtdf�|j�}|j	�}|j
�tj|d�|j
�t
j�|jt��}tj|d�WdQX|j|jjtj�WdQXdS(Ni�i(RRR	RR�R!R"R�tfilenotmakefileR�RR�R�R�RvtOSErrorR�R�R$tEBADF(R&R�tfdRMR'((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_makefile_close0s


c
Cstjt��tjtj�}|jtdf�|jt�tj	|dtj
dt�}d}xytr�y|d7}|j�PWqitj
k
r�tj|ggg�qitjk
r�tjg|gg�qiXqiW|j�tjrtjjd|�nWdQXdS(Ni�RHR�iis9
Needed %d calls to do_handshake() to establish session.
(RRR	R!R"R�RRkRR�RdRjRRRRR�RRRR(R&R�tcount((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_non_blocking_handshakeDs(
			


	cs?d�fd�}|tdt�tjr;|dd�ndS(Nc	s%tj|��tj||f�}|sE�jd||f�nytj||fdt�}Wn6tjk
r�}tjr�tj	j
d|�q�nX�jd|||f�tj||fd|�}|s��jd||f�ntjrtj	j
d|||f�nWdQXdS(NsNo server certificate on %s:%s!Rs%s
s$Got server certificate %s for %s:%s!s&
Verified certificate for %s:%s is
%s
(RRRtget_server_certificateR�R�RERRRR(thosttportR�R�R�(R&(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt_test_get_server_certificate[s"
			i�sipv6.google.com(R�R	RRtIPV6_ENABLED(R&R*((R&s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_get_server_certificateZs	cCstdf}tj|d���ttjtjtj�dtjdd���}|j	|�WdQXttjtjtj�dtjdd���}|j	|�WdQX|j
tjd��Qttjtj���2}tj|dtjdd�}|j	|�WdQXWdQXWdQXdS(	Ni�iRHtciphersReRfsNo cipher can be selecteds^$:,;?*'dorothyx(R	RRRRR�R!R"RdR�R�RE(R&tremoteR�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRhuscCs�tjt���tjtj�}tj|_|jdt	�|j
|j�g�|jt
j
t
j��}|jtdf�z|j�}|j|�Wd|j�X|j
t|j��d�WdQXdS(NR
i�i(RRR	RRDR
RfRmR�RR�R�R�R!R"R�R
R�R�R(R&RR�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_get_ca_certs_capath�scCs�tjt���tjtj�}tjtj�}tjtj�}t	|j
|���u}|jtdf�|j|j
|�|j|jj
|�||_
|j|j
|�|j|jj
|�WdQXWdQXdS(Ni�(RRR	RRDR�R
R!R"RR�R�R�tcontextt_sslobj(R&tctx1tctx2R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_context_setget�s	(R)R*RRRRRRRRRHR�RR
R$R&R,RhR/R�R4(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRvs								$				(tmake_https_servertThreadedEchoServercBs{eZdejfd��YZddddeeeddddd�Zd�Z	d�Z
dd�Zd�Zd�Z
RS(	tConnectionHandlercBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s�A mildly complicated class, because we want it to work both
            with and without the SSL wrapper around the socket connection, so
            that we can test the STARTTLS functionality.cCsZ||_t|_||_||_|jjd�d|_tj	j
|�t|_dS(Ni(
tserverRktrunningR�taddrRR�tsslconnt	threadingtThreadt__init__Rjtdaemon(R&R8tconnsockR:((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR>�s					cCs�y]|jjj|jdt�|_|jjj|jj��|jj	j|jj
��Wn)tjt
jtfk
r�}|jtjtjtjfkr�|jjjt|��|jjr�tdt|j�d�nt|_|j�tSt|tj�r$|jtjkr$�n|jjj|�|jjratdt|j�d�nt|_|jj�|j�tSn"X|jjjtj kr:|jj!�}t"j#r�|jjr�t$j%j&dt'j(|�d�n|jj!t�}t"j#r:|jjr:t$j%j&dtt)|��d�q:n|jj*�}t"j#r�|jjr�t$j%j&dt|�d�t$j%j&d	t|jj��d�ntSdS(
NR�s'
 server:  bad connection attempt from s:
s client cert is s
s cert binary is s bytes
s" server: connection cipher is now s" server: selected protocol is now (+R8R0R�R�RjR;tselected_npn_protocolstappendtselected_npn_protocoltselected_alpn_protocolstselected_alpn_protocolRRER!R�R!R$t
ECONNRESETtEPIPEt	ESHUTDOWNtconn_errorsR�tchattyRtreprR:RkR9R�R'tstopRmRfR
RRRRRR�R�Rtcipher(R&R'R�tcert_binaryRM((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt	wrap_conn�sH !	
%	

$*	!cCs*|jr|jj�S|jjd�SdS(Ni(R;R�R�R�(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR��s	
cCs-|jr|jj|�S|jj|�SdS(N(R;RR�R�(R&R%((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�s	cCs*|jr|jj�n
|jj�dS(N(R;R�R�(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�s	cCs�t|_|jjs(|j�s(dSnx�|jr�yE|j�}|j�}|skt|_|j�n
|dkr�t	j
r�|jjr�tj
jd�n|j�dS|jjr
|dkr
t	j
r�|jjr�tj
jd�n|jd�|j�sxdSnk|jjr�|jr�|dkr�t	j
rV|jjrVtj
jd�n|jd�|jj�|_d|_t	j
rx|jjrxtj
jd�qxn�|d	krt	j
r�|jjr�tj
jd
�n|jjd�}|jt|�jd�d
�nft	j
re|jjre|jr6dp9d}tj
jd|||j�|f�n|j|j��Wq+tjk
r�|jjr�td�n|j�t|_|jj�q+Xq+WdS(Ntovers" server: client closed connection
tSTARTTLSs2 server: read STARTTLS from client, sending OK...
sOK
tENDTLSs0 server: read ENDTLS from client, sending OK...
s* server: connection is now unencrypted...
s
CB tls-uniques@ server: read CB tls-unique from client, sending our CB data...
s
tls-uniquesus-asciis
t	encryptedtunencrypteds/ server: read %r (%s), sending back %r (%s)...
sTest server failure:
(RjR9R8tstarttls_serverROR�tstripRkR�RRtconnectionchattyRRRR;tunwrapR�R�R
RKRRXRRERJRRL(R&tmsgtstrippedtdatatctype((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytrunsb		



	#	

	(	R)R*t__doc__R>ROR�RR�R](((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR7�s	
	:			cCs`|r||_n�tj|dk	r*|ntj�|_|dk	rK|ntj|j_|rs|jj|�n|r�|jj|�n|r�|jj	|�n|	r�|jj
|	�n|
r�|jj|
�n||_||_
||_tj�|_tj|j�|_d|_t|_g|_g|_g|_tjj|�t|_dS(N(R0RRDR�tPROTOCOL_TLSRdRmR�R�tset_npn_protocolstset_alpn_protocolsRgRJRWRUR!R�Rt	bind_portR)tflagRktactiveRARDRIR<R=R>RjR?(R&tcertificateR�tcertreqstcacertsRJRWRUt
npn_protocolstalpn_protocolsR-R0((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR>Bs:								cCs$|jtj��|jj�|S(N(tstartR<tEventRctwait(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt	__enter__fs
cGs|j�|j�dS(N(RLR(R&RJ((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt__exit__ks
cCs||_tjj|�dS(N(RcR<R=Rj(R&Rc((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRjos	cCs	|jjd�|jjd�t|_|jrB|jj�nx�|jr�yu|jj�\}}tj	r�|j
r�tjj
dt|�d�n|j|||�}|j�|j�WqEtjk
r�qEtk
r�|j�qEXqEW|jj�dS(Ng�������?is server:  new connection from s
(R�R�R�RjRdRcR#R�RRRJRRRRKR7RjRR!R�tKeyboardInterruptRLR�(R&tnewconntconnaddrthandler((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR]ss&			

cCs
t|_dS(N(RkRd(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRL�sN(R)R*R<R=R7R�RjRkR>RmRnRjR]RL(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR6�s�	 			tAsyncoreEchoServercBsceZdejfd��YZd�Zd�Zd�Zd�Zd	d�Z
d�Zd�ZRS(
t
EchoServercBs<eZdejfd��YZd�Zd�Zd�ZRS(R7cBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsQtj|dtd|dt�|_tjj||j�t|_|j	�dS(NR�R�R�(
RR�RjRkR!tasyncoretdispatcher_with_sendR>t_ssl_acceptingt_do_ssl_handshake(R&tconnR�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR>�s	cCsBt|jtj�r>x&|jj�dkr:|j�qWntS(Ni(R'R!Rt	SSLSockettpendingthandle_read_eventRj(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytreadable�scCs�y|jj�Wn�tjtjfk
r1dStjk
rK|j�Stjk
ra�n?tjk
r�}|j	dt
jkr�|j�Sn
Xt|_
dS(Ni(R!RRRRtSSLEOFErrorthandle_closeRER�RJR$tECONNABORTEDRkRw(R&Ra((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRx�s
cCsu|jr|j�n[|jd�}tjrKtjjdt|��n|s^|j	�n|j
|j��dS(Nis server:  read %s from client
(RwRxR�RRRRRRKR�R�RX(R&R[((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pythandle_read�s	
	
cCs1|j�tjr-tjjd|j�ndS(Ns server:  closed connection %s
(R�RRRRRR!(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�s
	cCs�dS(N((R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�s(R)R*R>R}RxR�RR(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR7�s					cCsZ||_tjtjtj�}tj|d�|_tjj	||�|j
d�dS(NRCi(R�R!R"tSOCK_STREAMRRbR)Rut
dispatcherR>R�(R&R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR>�s
	cCsI|j�\}}tjr2tjjd|�n|j||j�dS(Ns$ server:  new connection from %s:%s
(R�RRRRRR7R�(R&tsock_objR:((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
handle_accept�s	cCs�dS(N((R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�s(R)R*RuRvR7R>R�R(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRt�s3		cCsPd|_t|_|j|�|_|jj|_tjj	|�t
|_dS(N(R�RcRkRdRtR8R)R<R=R>RjR?(R&R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR>�s		cCsd|jj|jfS(Ns<%s %s>(t	__class__R)R8(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt__str__�scCs$|jtj��|jj�|S(N(RjR<RkRcRl(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRm�s
cGs|tjrtjjd�n|j�tjrBtjjd�n|j�tjrhtjjd�ntjdt	�dS(Ns cleanup: stopping server.
s! cleanup: joining server thread.
s cleanup: successfully joined.
t
ignore_all(
RRRRRRLRRut	close_allRj(R&RJ((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRn�s	
	
	cCs||_tjj|�dS(N(RcR<R=Rj(R&Rc((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRj�s	cCsQt|_|jr"|jj�nx(|jrLytjd�Wq%q%Xq%WdS(Ni(RjRdRcR#Rutloop(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR]�s		cCst|_|jj�dS(N(RkRdR8R�(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRL�s	N(
R)R*RuR�RtR>R�RmRnR�RjR]RL(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRs�sE					
sFOO
cCs�i}td|d|dt�}|��t|jtj�d|����}|jt|jf�x�|t|�t	|�gD]�}	|r�t
jr�tj
jd|�q�n|j|	�|j�}
|r�t
jr�tj
jd|
�q�n|
|j�kr~td|
d t|
�|d j�t|�f��q~q~W|jd	�|rpt
jrptj
jd
�qpn|ji|j�d6|j�d6|j�d
6|j�d6|j�d6|j�d6�|j�WdQX|j|d<|j|d<WdQX|S(sc
        Launch a server, connect a client to it and try various reads
        and writes.
        R0RJRWR	s client:  sending %r...
s client:  read %r
s4bad data <<%r>> (%d) received; expected <<%r>> (%d)
isover
s client:  closing connection.
tcompressionRMtpeercerttclient_alpn_protocoltclient_npn_protocolR�Ntserver_alpn_protocolstserver_npn_protocols(R6RkRR�R!R�R�R)R�t
memoryviewRRRRRR�RXtAssertionErrorRR(R�RMR
RERCR�R�RDRA(tclient_contexttserver_contexttindataRJRWtsni_nameR�R8R�targtoutdata((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytserver_params_testsL	"		
	'
		





c
Cs|dkrtj}nidtj6dtj6dtj6|}tjr�|rUdpXd}tjj	|tj
|�tj
|�|f�ntj|�}|j|O_tj|�}	|	j|O_|j
tjkr�|jd�nx7||	fD])}
||
_|
jt�|
jt�q�Wyt||	dtdt�}WnStjk
rf|r�qn�tjk
r�}|s�|jtjkr�qnkX|s�td	tj
|�tj
|�f��n9|tk	r||d
krtd||d
f��ndS(
sT
        Try to SSL-connect using *client_protocol* to *server_protocol*.
        If *expect_success* is true, assert that the connection succeeds,
        if it's false, assert that the connection fails.
        Also, if *expect_success* is a string, assert that it is the protocol
        version actually used by the connection.
        RdReRfs %s->%s %s
s
 {%s->%s} %s
ReRJRWs5Client protocol %s succeeded with server protocol %s!R�s%version mismatch: expected %r, got %rN(R�RRdReRfRRRRRtget_protocol_nameRDRjRaR
RgRmR�R�R�R�RkRER!R�R$RFR�Rj(
tserver_protocoltclient_protocoltexpect_successt	certsreqstserver_optionstclient_optionstcerttypet	formatstrR�R�RR�R'((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttry_protocol_combo/sR	


		
	
t
ThreadedTestscBs�eZed��Zd�Zeje�d�d��Zd�Z	d�Z
d�Zeejee
d�d�d	���Zeed
���Zeejee
d�d�d
���Zed��Zeejee
d�d�ed����Zeejee
d�d�d���Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zeje
j d �d!��Z!eje
j"d"�d#��Z#ejd$e
j$kd%�d&��Z%d'�Z&ejee
d(�d)�d*��Z'd+�Z(d,�Z)eje
j*d-�d.��Z+eje
j*d/�d0��Z,d1�Z-eje
j.d2�d3��Z/d4�Z0d5�Z1e2d6��Z3e2d7��Z4e2d8��Z5e2d9��Z6d:�Z7RS(;cCsftjrtjjd�nxCtD];}tj|�}|jt	�t
||dtdt�q#WdS(s2Basic test of an SSL client connecting to a servers
RJRWN(RRRRRR`RRDR�R�R�Rj(R&RaR0((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt	test_echoms	

c	Cs�tjrtjjd�ntjtj�}tj|_	|j
t�|jt�t
d|dt�}|�x|jtj�dt�}|jt|jf�|jt��|j�WdQX|j�|j�}|j|d�|j�}tjr:tjjtj|�d�tjjdt|�d�nd|krc|jd	tj|��nd|dkr�|jd�n|jd
|�|jd|�tj|d
�}tj|d�}|j ||�|j!�WdQXdS(Ns
R0RJR�sCan't get peer certificate.sConnection cipher is s.
R�s$No subject field in certificate: %s.RsPython Software FoundationskMissing or invalid 'organizationName' field in certificate subject; should be 'Python Software Foundation'.R�R�(RsPython Software Foundation((RsPython Software Foundation("RRRRRRRDR
RfRmR�R�R�R6RkR�R!R�R�R)RvR�R
RR�RMR�R�R�R�RhRLR�R�(R&R0R8R�R�RMtbeforetafter((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_getpeercertxsB	

	
	!	

s!verify_flags need OpenSSL > 0.9.8cCstjrtjjd�ntjtj�}|jt	�tjtj�}tj
|_|jt
�ttdd�}|j|jtj|B�td|dt�}|�[t|jtj����9}|jt|jf�|j�}|j|d�WdQXWdQX|jtjO_td|dt�}|�[t|jtj����9}|jtjd��|jt|jf�WdQXWdQXWdQX|jt�td|dt�}|�[t|jtj����9}|jt|jf�|j�}|j|d�WdQXWdQXdS(Ns
RoiR0RJsCan't get peer certificate.scertificate verify failed( RRRRRRRDR�R�tSIGNED_CERTFILERfRmR�R�RpR�RqRrR6RjRR�R!R�R�R)R
R�RsR�REtCRLFILE(R&R�R0RvR8R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_crl_check�s:	


(
cCs�tjrtjjd�ntjtj�}|jt	�tjtj�}tj
|_t|_
|jt�td|dt�}|�at|jtj�dd���9}|jt|jf�|j�}|j|d�WdQXWdQXtd|dt�}|�at|jtj�dd���9}|jtjd��|jt|jf�WdQXWdQXWdQXtd|dt�}|�Fttj���-}|jtd	��|j|�WdQXWdQXWdQXdS(
Ns
R0RJR	R�sCan't get peer certificate.tinvalids.hostname 'invalid' doesn't match u?'localhost's'check_hostname requires server_hostname(RRRRRRRDR�R�R�RfRmRjR�R�R�R6RR�R!R�R�R)R
R�R�RR�(R&R�R0R8R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR��s8	
	

(	
cCsWtjjtjjt�p!tjd�}ttdtj	dt
dtdt�}|��tt
j
����}ttj|d|dtj����}y|jt|jf�Wn�tjk
r�}tjrAtjjd|�qAn[t
jk
r3}|jtjkr�ntjrAtjjd	|�qAnX|jd
�WdQXWdQXWdQXdS(s�Connecting when the server rejects the client's certificate

            Launch a server with CERT_REQUIRED, and check that trying to
            connect to it with a wrong client certificate fails.
            skeycert.pemRfRgRJRWR�R�s
SSLError is %r
s
socket.error is %r
s'Use of invalid cert should have failed!N(RRRRR	R�R6R�RRfR�RkRR!R�R�R�R�R)RERRRRRR�R$RFR�(R&R�R8R�R�R'((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_wrong_cert�s,!						cs�tj��tj��tj��tj�t�����fd�}����fd�}tjd|�}|j�z|�Wd|j�XdS(s|A brutal shutdown of an SSL server should raise an OSError
            in the client when attempting handshake.
            csK�jd��j��j�\}}|j��j��j�dS(Ni(R�R#R�R�(tnewsockR:(t
listener_gonetlistener_readyR�(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytlistener	s



c	s}�j�ttj���[}|jt�f��j�ytj|�}Wntjk
renX�jd�WdQXdS(Ns2connecting to closed SSL socket should have failed(	RlRR!R�R�RR�R�R�(Rtssl_sock(R�R�R)R&(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt	connector&	s

ttargetN(	R<RkR!RRbR�R=RjR(R&R�R�R�((R�R�R)R�R&s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_rude_shutdown	s
RAs)OpenSSL is compiled without SSLv2 supportcCstjrtjjd�nttjtjt�ttjtjttj	�ttjtjttj
�ttjtjt�ttjtj
t�ttjtjt�t�r�ttjtjtdtj�nttjtjtdtj�ttjtjtdtj�dS(s9Connecting to an SSLv2 server with various client optionss
R�N(RRRRRR�RRARjReRfR
RktPROTOCOL_SSLv3R�R.RlRmRn(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_protocol_sslv29	s		

cCs!tjrtjjd�nttd�r�yttjtj	t
�Wq�tjk
r�}tjr�tjjdt
|��q�q�Xnttd�r�ttjtjt�nttjtjt
�ttjtjd�ttd�r	ttjtjttj�nttjtjt
tj�ttjtjdtj�ttd�rottjtjttj�nttjtjt
tj�ttjtjdtj�ttd�r�ttjtjtdtj�nttjtjt
dtjtjB�ttjtjtdtj�dS(s:Connecting to an SSLv23 server with various client optionss
RAs; SSL2 client to SSL23 server test unexpectedly failed:
 %s
R�RTR�N(RRRRRRNRR�R
RARjR!R�R�R�RkR�ReRfRmRlRn(R&R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_protocol_sslv23P	s:			
R�s)OpenSSL is compiled without SSLv3 supportcCs�tjrtjjd�nttjtjd�ttjtjdtj�ttjtjdtj	�t
td�r�ttjtjt�nttjtj
tdtj�ttjtjt�t�r�ttjtj
tdtj�ndS(s9Connecting to an SSLv3 server with various client optionss
tSSLv3RAR�N(RRRRRR�RR�ReRfRNRARkR
RmR�R.Rl(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_protocol_sslv3y	s	
	cCs�tjrtjjd�nttjtjd�ttjtjdtj�ttjtjdtj	�t
td�r�ttjtjt�nt
td�r�ttjtj
t�nttjtjtdtj�dS(s8Connecting to a TLSv1 server with various client optionss
RTRAR�R�N(RRRRRR�RR�ReRfRNRARkR�R
Rn(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_protocol_tlsv1�	s	tPROTOCOL_TLSv1_1sTLS version 1.1 not supported.cCs�tjrtjjd�nttjtjd�ttd�rZttjtj	t
�nttd�r�ttjtjt
�nttjtjt
dtj
�ttjtjd�ttjtjt
�ttjtjt
�dS(snConnecting to a TLSv1.1 server with various client options.
               Testing against older TLS versions.s
sTLSv1.1RAR�R�N(RRRRRR�RR�RNRARkR�R
RpR�(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_protocol_tlsv1_1�	s	
tPROTOCOL_TLSv1_2sTLS version 1.2 not supported.c	Cs3tjrtjjd�nttjtjddtjtj	Bdtjtj	B�t
td�rzttjtjt�nt
td�r�ttjtj
t�nttjtjtdtj�ttjtjd�ttjtjt�ttjtjt�ttjtjt�ttjtjt�dS(snConnecting to a TLSv1.2 server with various client options.
               Testing against older TLS versions.s
sTLSv1.2R�R�RAR�N(RRRRRR�RR�RmRlRNRARkR�R
RqR�R�(R&((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_protocol_tlsv1_2�	s 	
c	
Cs8d}ttd	tjd
tdtdt�}t}|��tj�}|jd
�|jt	|j
f�tjr�t
jjd�nxJ|D]B}tjr�t
jjd|�n|r�|j|�|j�}n|j|�|jd�}|j�j�}|dkr^|jd�r^tjr=t
jjd|�ntj|d	tj�}t}q�|dkr�|jd�r�tjr�t
jjd|�n|j�}t}q�tjr�t
jjd|�q�q�Wtjr�t
jjd�n|r|jd�n
|jd�|r$|j�n
|j�WdQXdS(s6Switching from clear text to encrypted and back again.smsg 1sMSG 2RQsMSG 3smsg 4RRsmsg 5smsg 6R�RURJRWis
s client:  sending %r...
iR�s/ client:  read %r from server, starting TLS...
s- client:  read %r from server, ending TLS...
s client:  read %r from server
s client:  closing connection.
sover
N(smsg 1sMSG 2RQsMSG 3smsg 4RRsmsg 5smsg 6(R6R�RR�RjRkR!RR�R�R)RRRRRR�R�R�RVRXR�R�RXR�(	R&tmsgsR8twrappedR�R�RyR�RY((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
test_starttls�	s`			
	
		

									

cCs9t|dt�}tjr.tjjd�nttd��}|j�}WdQXd}d|j	t
jjt�df}t
jdt�}tj|d	|�}zu|j�jd
�}|rt|�dkr|jt|��}tjrtjjdt|�|f�qnWd|j�X|j||�dS(
s:Using a SocketServer to create and manage SSL connections.R�s
trbNRCshttps://localhost:%d/%siRR0scontent-lengthis/ client: read %d bytes from remote server '%s'
(R5R�RRRRRRWR�R)RRtsplitRR�turllib2turlopentinfot	getheaderR�RR�R�(R&R8RMR�R�turlR0tdlen((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_socketserver
s(	 		cCs^tjrtjjd�nd}tt�}|�$tjt	j	��}|j
d|jf�tjr�tjjd|�n|j|�|j�}tjr�tjjd|�n||j
�kr|jd|d t|�|d j
�t|�f�n|jd�tjr.tjjd	�n|j�tjrTtjjd
�nWdQXdS(s'Check the example asyncore integration.s
sFOO
s	127.0.0.1s client:  sending %r...
s client:  read %r
s4bad data <<%r>> (%d) received; expected <<%r>> (%d)
isover
s client:  closing connection.
s client:  connection closed.
N(RRRRRRsR�RR�R!R�R)R�RXR�RR�(R&R�R8R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_asyncore_server
s2			
	!
	
	cs=tjrtjjd�nttdtjdtj	dtdt
dt�}|��tjt
j
�dtdtd	td
tjdtj	���jt|jf��fd�}�fd�}d
�jt
gfd�jtdgfd�jt
gfg}d�jt
gfd�jtdgfd|t
gfd|tgfg}d}x|D]\}}}	}
||jd�}yw|||
��j�}||j�kr�|jdjd|d|d dt|�d|d dt|���nWqWtk
ra}
|	r'|jdjd|��nt|
�j|�sb|jdjd|d |
��qbqWXqWWx|D]\}}}	}
||jd�}yw�j|�||
�}||j�kr|jd!jd|d|d dt|�d|d dt|���nWqmtk
r�}
|	r=|jd"jd|��nt|
�j|�st|jdjd|d |
��n�j�qmXqmWd#}�j|�tt|��}|j �jd$|�t|��|j ||�|j!t"�j#��jd%�|j!t�jd$�|j!t�jd$��j$�Wd&QXd&S('s Test recv(), send() and friends.s
RfR�RgRJRWR�R�RRHcs'tdd�}�j|�}|| S(Nsid(R�R�(tbR%(R�(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
_recv_intoO
scs-tdd�}�j|�\}}|| S(Nsid(R�R�(R�R%R:(R�(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt_recvfrom_intoT
sR�R�ssome.addresstsendallR�R�R�R�uPREFIX_RspWhile sending with <<{name:s}>> bad data <<{outdata:r}>> ({nout:d}) received; expected <<{indata:r}>> ({nin:d})
R
R�itnoutR�tnins>Failed to send with method <<{name:s}>>; expected to succeed.
sFMethod <<{name:s}>> failed with unexpected exception message: {exp:s}
texpsrWhile receiving with <<{name:s}>> bad data <<{outdata:r}>> ({nout:d}) received; expected <<{indata:r}>> ({nin:d})
sAFailed to receive with method <<{name:s}>>; expected to succeed.
R[i����sover
N(%RRRRRR6R�RRdR�RjRkR�R!R�R�R)R�R�R�R�R�RR�RXR�R�RR�R�R�R�R�RvR�R�R�(R&R8R�R�tsend_methodstrecv_methodstdata_prefixt	meth_namet	send_methR�RJR�R�R't	recv_methR[tbuffer((R�s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_recv_send;
s�						
	!	
	
	!	
	
"
cCstt�}|j�|j|jdd�tjt|j	f�}|j|j
�tj|dt
�}|j|j
�|jd�|j|jd�d�|j|jd�d�|j|j�d�|jt
�|j|jd�d�|j|jt��d�dS(Ntsuppress_ragged_eofsR[iRC(R6R�RmR�RnR�R!tcreate_connectionR�R)R�RR�RkR�R�R�R�RR�R�(R&R8R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_recv_zero�
s


cs\tjtj��d}tj��}tj��t����fd�}tjd|�}|j��j	�z�zRtjtj�}|j
d�|j||f�|jt
jdt
j|�Wd|j�XzTtjtj�}t
j|�}|j
d�|jt
jd|j||f�Wd|j�XWdt�|j��j�XdS(Ns	127.0.0.1cs��jd��j�g}xT�sstj�gggd�\}}}�|kr |j�j�d�q q Wx|D]}|j�q{WdS(Nig�������?i(R�R#RRBR�R�(tconnsRStwR'R�(tfinishR8tstarted(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytserve�
s

	$
R�g�������?s	timed out(R!R"RRbR<RkRkR=RjRlR�R�R�RRER�R�RjR(R&R(R)R�R�R((R�R8R�s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_handshake_timeout�
s6





csvtjtj�}tj|_|jt�|jt�tjtj	��d}t
j��}|j�dt
��tj��dg�dg�����fd�}tjd|�}|j��j�|jtj��}|j||f�|jd�|j�|j�}|j�|j��dj��j�|j�dtj�|j�d|�dS(Ns	127.0.0.1R�csS�jd��j��j�\�d<�d<�dj�djd��dS(Niii(R�R#R�R�R�((tevttpeerR.R8(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�s

R�R[i(RRDR
RfRmR�R�R�R!R"RRbR�RjR<RkR�R=RjRlR�R�R�R�R�RR�RzR�(R&R0R(R)R�R�tclienttclient_addr((R�R�R.R8s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_server_accept�
s4

		






c	Csxtjtj�}t|jtj����E}|jtj��}|j�WdQX|j	|j
jtj�WdQXdS(N(
RRDR
RR�R!RvR�R
R�R�R$tENOTCONN(R&R0R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_getpeercert_enotconns
c	Csxtjtj�}t|jtj����E}|jtj��}|j�WdQX|j	|j
jtj�WdQXdS(N(
RRDR
RR�R!RvR�RR�R�R$R�(R&R0R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_do_handshake_enotconn%s
cCs�tjtj�}|jt�tjtj�}tj|_t|_|j	tj
O_	|jd�|jd�td|��Q}|j
tj�dd�}|jtj��|jt|jf�WdQXWdQX|jdt|jd��dS(NtAES128tAES256R0R	R�sno shared cipheri(RRDR
R�R�RfRmRjR�RjRoRgR6R�R!RvRER�R�R)RhR�RI(R&R�R�R8R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_no_shared_ciphers,s
	

	"cCs�tjtj�}ttdtjdt���}t|jtj����I}|j	|j
�d�|jt
|jf�|j|j
�d�WdQX|j	|j
�d�WdQXdS(s�
            Basic tests for SSLSocket.version().
            More tests are done in the test_protocol_*() methods.
            R�RJRTN(RRDR�R6R�RkRR�R!R�R�R�R�R�R)R�(R&R0R8R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_version_basic@s		s%test requires TLSv1.3 enabled OpenSSLc
Cs�tjtj�}|jt�|jtjtjBtjBO_t	d|��h}|j
tj��}t|��>|j
t|jf�|j|j�ddddg�WdQXWdQXdS(NR0itTLS_AES_256_GCM_SHA384tTLS_CHACHA20_POLY1305_SHA256tTLS_AES_128_GCM_SHA256(RRDR_R�R�RjRnRpRqR6R�R!RR�R�R)RhRM(R&R0R8R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_tls1_3Os

s"test requires ECDH-enabled OpenSSLcCs�tjtj�}|jt�|jtjO_tjdkrP|jd�nt	d|��[}t
|jtj����7}|j
t|jf�|jd|j�d�WdQXWdQXdS(Niis
ECCdraft:ECDHR0tECDH(iii(RRDR
R�R�RjRoR-RgR6RR�R!R�R�R)RhRM(R&R0R8R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_default_ecdh_curvebs
s
tls-uniques*'tls-unique' channel binding not availablecCsItjrtjjd�nttdtjdtj	dtdt
dt�}|��tjt
j
�dtdtd	td
tjdtj	�}|jt|jf�|jd�}tjr�tjjdj|��n|j|�|jt|�d
�|jd�|j�j�}|j|t|�jd��|j�tjt
j
�dtdtd	td
tjdtj	�}|jt|jf�|jd�}tjr�tjjdj|��n|j||�|j|�|jt|�d
�|jd�|j�j�}|j|t|�jd��|j�WdQXdS(s Test tls-unique channel binding.s
RfR�RgRJRWR�R�RRHs
tls-uniques! got channel binding data: {0!r}
isCB tls-unique
sus-asciis) got another channel binding data: {0!r}
N(RRRRRR6R�RRdR�RjRkR�R!R�R�R)R
R�tassertIsNotNoneR�RR�RVRKRR�tassertNotEqual(R&R8R�tcb_datatpeer_data_reprtnew_cb_data((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyRvs\							


	
		


	cCs�tjtj�}|jt�t||dtdt�}tjrct	j
jdj|d��n|j
|ddddh�dS(NRJRWs got compression: {!r}
R�tZLIBtRLE(RRDR�R�R�R�RjRRRRRR�RhR�(R&R0R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_compression�s
	 Rs*ssl.OP_NO_COMPRESSION needed for this testcCsdtjtj�}|jt�|jtjO_t||dtdt�}|j	|dd�dS(NRJRWR�(RRDR�R�R�RjRR�RjR�R�(R&R0R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_compression_disabled�s
cCs�tjtj�}|jt�|jt�|jd�t||dt	dt	�}|dd}|j
d�}d|kr�d|kr�d	|kr�|jd
|d�ndS(NtkEDHRJRWRMit-tADHtEDHtDHEsNon-DH cipher: (RRDR�R�R�R�R�RgR�RjR�R�(R&R0R�RMtparts((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_dh_params�s


$cCsRtjtj�}|jt�t||dtdt�}|j|dd�dS(NRJRWR�(	RRDR�R�R�R�RjR�R�(R&R0R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_selected_alpn_protocol�s

sALPN support requiredcCs�tjtj�}|jt�tjtj�}|jt�|jddg�t||dtdt�}|j	|dd�dS(NRttbarRJRWR�(RRDR�R�R�R�RaR�RjR�R�(R&R�R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt/test_selected_alpn_protocol_if_server_uses_alpn�s

s!ALPN support needed for this testcCs�dddg}ddgdfddgdfdgdfddgdfg}xn|D]f\}}tjtj�}|jt�|j|�tjtj�}|jt�|j|�yt||dtdt�}Wntj	k
r�}|}nX|dkr.t
r.tjdkr.|j|tj	�qUdt
|�t
|�t
|�f}	|d}
|j|
||	|
d
f�t|d�r�|ddnd}|j|||	|df�qUWdS(NRtRt	milkshakeshttp/3.0shttp/4.0RJRWiiisKfailed trying %s (s) and %s (c).
was expecting %s, but got %%s from the %%sR�R�R�i����tnothingR8(iiii(R�RRDR�R�R�RaR�RjREtIS_OPENSSL_1_1R-R�R�R�R(R&tserver_protocolstprotocol_teststclient_protocolsR>R�R�R�R'RYt
client_resultt
server_result((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_alpn_protocols�s>






$cCsRtjtj�}|jt�t||dtdt�}|j|dd�dS(NRJRWR�(	RRDR�R�R�R�RjR�R�(R&R0R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_selected_npn_protocols

s NPN support needed for this testcCsiddg}ddgdfddgdfddgdfddgdfg}x|D]\}}tjtj�}|jt�|j|�tjtj�}|jt�|j|�t||dtdt�}dt|�t|�t|�f}|d	}	|j	|	|||	d
f�t
|d�r>|ddnd
}
|j	|
|||
df�qUWdS(Nshttp/1.1sspdy/2ttesttabctdefRJRWsKfailed trying %s (s) and %s (c).
was expecting %s, but got %%s from the %%sR�R�R�i����RR8(RRDR�R�R�R`R�RjR�R�R(R&R
RRR>R�R�R�RYRR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_npn_protocolss*




$cCsvtjtj�}|jt�tjtj�}|jt�tjtj�}tj|_|jt	�|||fS(N(
RRDR�R�R�tSIGNED_CERTFILE2RfRmR�R�(R&R�t
other_contextR�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytsni_contexts5s


cCs+|d}|jd|ff|d�dS(NR�R�R�(Rh(R&R�R
R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytcheck_common_name?s
csg�|j�\}�}��fd�}|j|�t||dtdd�}|j�d|fg�|j|d�g�t||dtdd�}|j�d|fg�|j|d�g�|jd�t||dtdd�}|j|d�|j�g�dS(Ncs/�j||f�|dk	r+�|_ndS(N(RBR�R0(R�tserver_nametinitial_context(tcallsR(s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
servername_cbHsRJR�tsupermessagetfakehostnameR�tnotfunny(RR�R�RjR�RR�(R&R�R�RR�((RRs4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�Cs,
		
	cCs{|j�\}}}d�}|j|�|jtj��"}t||dtdd�}WdQX|j|jj	d�dS(NcSstjS(N(RtALERT_DESCRIPTION_ACCESS_DENIED(R�RR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytcb_returning_alertosRJR�R tTLSV1_ALERT_ACCESS_DENIED(
RR�RvRRER�RkR�R�R�(R&R�RR�R$R�R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_sni_callback_alertjs	
cCs�|j�\}}}d�}|j|�|jtj��7}tj��"}t||dtdd�}WdQXWdQX|j	|j
jd�|jd|j
��dS(NcSsdddS(Ng�?g((R�RR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt
cb_raising~sRJR�R tSSLV3_ALERT_HANDSHAKE_FAILUREtZeroDivisionError(RR�RvRRERtcaptured_stderrR�RkR�R�R�Rhtgetvalue(R&R�RR�R'R�tstderrR�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyttest_sni_callback_raisingys	
cCs�|j�\}}}d�}|j|�|jtj��7}tj��"}t||dtdd�}WdQXWdQX|j	|j
jd�|jd|j
��dS(NcSsdS(NRt((R�RR((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pytcb_wrong_return_type�sRJR�R tTLSV1_ALERT_INTERNAL_ERRORRw(RR�RvRRERR*R�RkR�R�R�RhR+(R&R�RR�R.R�R,R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt#test_sni_callback_wrong_return_type�s	
cCs�tjtj�}tj|_|jt�|jt�td|dt	�}|�f|j
tj��}|jt
|jf�|j�|jt|jd�|jt|jd�WdQXdS(NR0RJithello(RRDR
RfRmR�R�R�R6RkR�R!R�R�R)R�RvR�R�R(R&R0R8R�((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt,test_read_write_after_close_raises_valuerror�s


(8R)R*RQR�R�RHR\R/R�R�R�R�RNRR�RbR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�tHAS_TLSv1_3R�RgR�R]RR�R�RRtHAS_ALPNR	RRtHAS_NPNRRRR�R�R&R-R0R2(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyR�ksn	&*	&	!	)(	:			w		1	'				;				
	*		
	'c
Cs�tjr�itjd6tjd6tjd6}xY|j�D]9\}}|�}|r:|dr:d||f}Pq:q:Wttj��}dtj	tj
fGHd|GHdtjGHd	tjGHyd
tj
GHWq�tk
r�q�Xnx]tttttttttttttg
D].}tjj|�stjd|��qqWt t!t"t#g}tj$d�rw|j%t&�nt'r�tj(�}|r�|j%t)�q�nztj*|�Wdt'r�tj+|�nXdS(
NtLinuxtMactWindowsis%s %rstest_ssl: testing with %r %rs          under %ss          HAS_SNI = %rs          OP_ALL = 0x%8xs          OP_NO_TLSv1_1 = 0x%8xsCan't read certificate file %rtnetwork(,RRRFRGtmac_vert	win32_vertitemsRKRR�R-RiRiRptAttributeErrorR�RR�R�R�R�R�R�RR�R�tBADKEYR�RRtexistst
TestFailedR_RRcR�tis_resource_enabledRBRt
_have_threadstthreading_setupR�trun_unittesttthreading_cleanup(RtplatsR
RLtplatR�tteststthread_info((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt	test_main�sL	


		
		t__main__(kRRHRRRttest.script_helperRRuR!RR0R9R�RR$R�R�R�RR�RFRXROt
contextlibRt
import_moduleRtsortedt_PROTOCOL_NAMESR`R�R�R�R�R-RRR�RR�R�R�R�R�R�R�R�R{RR�R�R�R�R�RR�R�R	RR�R�R�R>R�R�R�R�R�RpRRRRRRtTestCaseRR,R.R/R6R@RQRbR\RiR�RcR_R�RR<tImportErrorRkRBRjttest.ssl_serversR5R=R6RsR�R�R�R�RJR)(((s4/usr/local/python-2.7/lib/python2.7/test/test_ssl.pyt<module>s�										��i��$)�/

�u.;����E0
© 2025 GrazzMean