AlkantarClanX12
Current Path : /opt/alt/python35/lib64/python3.5/asyncio/__pycache__/ |
Current File : //opt/alt/python35/lib64/python3.5/asyncio/__pycache__/sslproto.cpython-35.opt-2.pyc |
���]]e � @ s d d l Z d d l Z y d d l Z Wn e k rB d Z Yn Xd d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d � Z d d � Z d Z d Z d Z d Z Gd d � d e � Z Gd d � d e j e j � Z Gd d � d e j � Z d S)� N� )�base_events)�compat)� protocols)� transports)�loggerc C s� | r t d � � t t d � r? t j � } | s� d | _ nL t j t j � } | j t j O_ | j t j O_ | j � t j | _ | S)Nz(Server side SSL needs a valid SSLContext�create_default_contextF) � ValueError�hasattr�sslr �check_hostnameZ SSLContextZPROTOCOL_SSLv23�optionsZOP_NO_SSLv2ZOP_NO_SSLv3Zset_default_verify_pathsZ CERT_REQUIRED�verify_mode)�server_side�server_hostname� sslcontext� r �-/opt/alt/python35/lib64/python3.5/sslproto.py�_create_transport_context s r c C s t t d � S)N� MemoryBIO)r r r r r r �_is_sslproto_available% s r Z UNWRAPPEDZDO_HANDSHAKEZWRAPPEDZSHUTDOWNc @ s� e Z d Z d Z d d d � Z e d d � � Z e d d � � Z e d d � � Z e d d � � Z d d d � Z d d d � Z d d � Z d d d � Z d d d � Z d S)�_SSLPipe� i Nc C sj | | _ | | _ | | _ t | _ t j � | _ t j � | _ d | _ d | _ d | _ d | _ d S)NF) �_context�_server_side�_server_hostname� _UNWRAPPED�_stater r � _incoming� _outgoing�_sslobj� _need_ssldata� _handshake_cb�_shutdown_cb)�self�contextr r r r r �__init__D s z_SSLPipe.__init__c C s | j S)N)r )r$ r r r r% Z s z_SSLPipe.contextc C s | j S)N)r )r$ r r r � ssl_object_ s z_SSLPipe.ssl_objectc C s | j S)N)r! )r$ r r r �need_ssldatag s z_SSLPipe.need_ssldatac C s | j t k S)N)r �_WRAPPED)r$ r r r �wrappedm s z_SSLPipe.wrappedc C s| | j t k r t d � � | j j | j | j d | j d | j �| _ t | _ | | _ | j d d d �\ } } | S)Nz"handshake in progress or completedr r � �only_handshakeT) r r �RuntimeErrorr Zwrap_bior r r r r � _DO_HANDSHAKEr"