/usr/lib/python2.6/site-packages/ndg/httpsclient/test
Edit: /usr/lib/python2.6/site-packages/ndg/httpsclient/test/test_https.pyc (5078B)
Ñò
˜KVc
@ sè d Z d Z d Z d Z d Z d Z d Z d d k Z e i d e i ƒ e i
e ƒ Z d d k
Z
d d k Z d d
k l Z d d k l Z d d k l Z d d
k l Z d e
i f d „ ƒ YZ e d j o e
i ƒ n d S( s• unit tests module for ndg.httpsclient.https.HTTPSconnection class
PyOpenSSL utility to make a httplib-like interface suitable for use with
urllib2
s P J Kershaw (STFC)s 06/01/12s2 (C) 2012 Science and Technology Facilities Councils- BSD - see LICENSE file in top-level directorys Philip.Kershaw@stfc.ac.uks $Id$iÿÿÿÿNt level( t SSL( t Constants( t HTTPSConnection( t ServerSSLCertVerificationt TestHTTPSConnectionc B sD e Z d Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( s+ Test ndg HTTPS client HTTPSConnection classc C s[ t t i d t i ƒ} | i ƒ | i d d ƒ | i ƒ } d | i ƒ GH| i ƒ d S( Nt portt GETt /s
Response = %s( R R t HOSTNAMEt PORTt connectt requestt getresponset readt close( t selft connt resp( ( sC /usr/lib/python2.6/site-packages/ndg/httpsclient/test/test_https.pyt test01_open s
c C s2 t t i d t i ƒ} | i t i | i ƒ d S( NR ( R R R t PORT2t assertRaisest sockett errorR ( R R ( ( sC /usr/lib/python2.6/site-packages/ndg/httpsclient/test/test_https.pyt test02_open_fails$ s c C s– t i t i ƒ } d „ } | i t i | ƒ | i d ƒ | i d t i ƒ t
t i d t i d | ƒ} | i
ƒ | i t i | i d d ƒ d S( Nc S s t i d | i ƒ ƒ | S( Ns/ SSL peer certificate verification failed for %r( t logt debugt get_subject( R t x509t errnumt errdeptht preverify_ok( ( sC /usr/lib/python2.6/site-packages/ndg/httpsclient/test/test_https.pyt verify_callback+ s
i R t ssl_contextR R ( R t Contextt TLSv1_METHODt
set_verifyt VERIFY_PEERt set_verify_deptht load_verify_locationst NoneR t UNITTEST_DIRR R R
R R t ErrorR ( R t ctxR R ( ( sC /usr/lib/python2.6/site-packages/ndg/httpsclient/test/test_https.pyt% test03_ssl_verification_of_peer_fails( s
c C s¥ t i t i ƒ } d „ } | i t i | ƒ | i d ƒ | i d t i ƒ t
t i d t i d | ƒ} | i
ƒ | i d d ƒ | i ƒ } d | i ƒ GHd S( Nc S s | S( ( ( R R R R R ( ( sC /usr/lib/python2.6/site-packages/ndg/httpsclient/test/test_https.pyt
> s i R R! R R s
Response = %s( R R" R# R$ R% R&