![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /lib/python2.7/site-packages/ndg/httpsclient/ |
� ��Oc @ s� d Z d Z d Z d Z d Z d Z d Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z e j e � Z d e f d � � YZ d e f d � � YZ d S( s� ndg_httpsclient HTTPS module containing PyOpenSSL implementation of httplib.HTTPSConnection PyOpenSSL utility to make a httplib-like interface suitable for use with urllib2 s P J Kershaw (STFC)s 09/12/11s2 (C) 2012 Science and Technology Facilities Councils- BSD - see LICENSE file in top-level directorys Philip.Kershaw@stfc.ac.uks $Id$i����N( t HTTPS_PORT( t HTTPConnection( t AbstractHTTPHandler( t SSL( t SSLSockett HTTPSConnectionc B sG e Z d Z e Z e j Z d d e j d d � Z d � Z d � Z RS( sT This class allows communication via SSL using PyOpenSSL. It is based on httplib.HTTPSConnection, modified to use PyOpenSSL. Note: This uses the constructor inherited from HTTPConnection to allow it to be used with httplib and HTTPSContextHandler. To use the class directly with an SSL context set ssl_context after construction. @cvar default_port: default port for this class (443) @type default_port: int @cvar default_ssl_method: default SSL method used if no SSL context is explicitly set - defaults to version 2/3. @type default_ssl_method: int c C su t j | | | | | � t | d � s4 d | _ n | d k rq t | t j � se t d | � � n | | _ n d S( Nt ssl_contextsL Expecting OpenSSL.SSL.Context type for "ssl_context" keyword; got %r instead( R t __init__t hasattrt NoneR t isinstanceR t Contextt TypeError( t selft hostt portt strictt timeoutR ( ( s9 /usr/lib/python2.7/site-packages/ndg/httpsclient/https.pyR , s c C s� t | d d � rI t | j t j � s= t d | j � � n | j } n t j | j j � } t j | j | j f | j � } t | d d � r� | | _ | j � n t | | � | _ | j j � d S( s. Create SSL socket and connect to peer R sN Expecting OpenSSL.SSL.Context type for "ssl_context" attribute; got %r insteadt _tunnel_hostN( t getattrR R R R R R t __class__t default_ssl_methodt sockett create_connectionR R R t sockt _tunnelR t set_connect_state( R R R ( ( s9 /usr/lib/python2.7/site-packages/ndg/httpsclient/https.pyt connect: s ! c C s | j j � d S( s) Close socket and shut down SSL connectionN( R t close( R ( ( s9 /usr/lib/python2.7/site-packages/ndg/httpsclient/https.pyR R s N( t __name__t __module__t __doc__R t default_portR t SSLv23_METHODR R R t _GLOBAL_DEFAULT_TIMEOUTR R R ( ( ( s9 /usr/lib/python2.7/site-packages/ndg/httpsclient/https.pyR s t HTTPSContextHandlerc B s, e Z d Z e j Z d d � Z d � Z RS( sS HTTPS handler that allows a SSL context to be set for the SSL connections. i c C sf t j | | � | d k rM t | t j � sA t d | � � n | | _ n t j t j � | _ d S( s� @param ssl_context:SSL context @type ssl_context: OpenSSL.SSL.Context @param debuglevel: debug level for HTTPSHandler @type debuglevel: int sL Expecting OpenSSL.SSL.Context type for "ssl_context" keyword; got %r insteadN( R R R R R R R R R! ( R R t debuglevel( ( s9 /usr/lib/python2.7/site-packages/ndg/httpsclient/https.pyR ] s c C s2 t d t t f i | j d 6� } | j | | � S( sc Opens HTTPS request @param req: HTTP request @return: HTTP Response object t CustomHTTPSContextConnectionR ( t typeR t objectR t do_open( R t reqt customHTTPSContextConnection( ( s9 /usr/lib/python2.7/site-packages/ndg/httpsclient/https.pyt https_openo s ( R R R R t do_request_t https_requestR R+ ( ( ( s9 /usr/lib/python2.7/site-packages/ndg/httpsclient/https.pyR# W s ( R t __author__t __date__t __copyright__t __license__t __contact__t __revision__t loggingR t httplibR R t urllib2R t OpenSSLR t ndg.httpsclient.ssl_socketR t getLoggerR t logR R# ( ( ( s9 /usr/lib/python2.7/site-packages/ndg/httpsclient/https.pyt <module> s <