Spade
Mini Shell
| Directory:~$ /proc/self/root/usr/lib/python2.7/site-packages/ndg/httpsclient/ |
| [Home] [System Details] [Kill Me] |
�
a�VOc@s�dZdZdZdZdZdZdZddlZdd lm Z dd
l
mZdefd��YZ
edd
�Zddddede jd�Zed�ZdS(sundg_httpsclient
SSL Context utilities module containing convenience routines
for setting SSL context configuration.
sP J Kershaw (STFC)s09/12/11s2(C) 2012 Science and Technology Facilities
Councils-BSD - see LICENSE file in top-level
directorysPhilip.Kershaw@stfc.ac.uks$Id$i����N(tSSL(tServerSSLCertVerificationtSSlContextConfigcBs&eZdZdddded�ZRS(s�
Holds configuration options for creating a SSL context. This is used as
a
template to create the contexts with specific verification callbacks.
cCs1||_||_||_||_||_dS(N(tkey_filet cert_filetpem_filetca_dirtverify_peer(tselfRRRRR((sD/usr/lib/python2.7/site-packages/ndg/httpsclient/ssl_context_util.pyt__init__s
N(t__name__t
__module__t__doc__tNonetFalseR (((sD/usr/lib/python2.7/site-packages/ndg/httpsclient/ssl_context_util.pyRscCs(t|j|j|j|j|j|�S(N(tmake_ssl_contextRRRRR(t
ssl_configturl((sD/usr/lib/python2.7/site-packages/ndg/httpsclient/ssl_context_util.pytmake_ssl_context_from_config
sc
Cs�tj|�}|r%|j|�n|r;|j|�n|rQ|j|�n|s]|rp|j||�nd�}|} |r�|jd�|r�t||�q�|jtj| �n|jtj | �|S(sL
Creates SSL context containing certificate and key file locations.
cSs|S(srDefault certification verification callback.
Performs no checks and returns the status passed in.
((tconntx509terrnumterrdepthtpreverify_ok((sD/usr/lib/python2.7/site-packages/ndg/httpsclient/ssl_context_util.pyt _callback9si (
RtContexttuse_certificate_filetuse_privatekey_filetload_verify_locationstset_verify_deptht&set_peer_verification_for_url_hostnamet
set_verifytVERIFY_PEERtVERIFY_NONE(
RRRRRRtmethodtssl_contextRtverify_callback((sD/usr/lib/python2.7/site-packages/ndg/httpsclient/ssl_context_util.pyR&s$
cCs[|s|j�tj@rWtj|�}|j}td|�}|jtj|�ndS(sbConvenience
routine to set peer verification callback based on
ServerSSLCertVerification classthostnameN(tget_verify_modeRR
turlparseR%RR(R#Rtif_verify_enabledturlObjR%R$((sD/usr/lib/python2.7/site-packages/ndg/httpsclient/ssl_context_util.pyRLs
(Rt
__author__t__date__t
__copyright__t__license__t__contact__t__revision__R'tOpenSSLRt%ndg.httpsclient.ssl_peer_verificationRtobjectRRR
Rt
SSLv23_METHODRR(((sD/usr/lib/python2.7/site-packages/ndg/httpsclient/ssl_context_util.pyt<module>s&