Your IP : 3.144.102.43
�
j fbc �
@ 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 � 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� )�compat)� protocols)�
transports)�loggerc C s� | r t d � � n t t d � rE t j � } | s� d | _ q� 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_SSLv23ZoptionsZOP_NO_SSLv2ZOP_NO_SSLv3Zset_default_verify_pathsZ
CERT_REQUIRED�verify_mode)�server_side�server_hostname�
sslcontext� r �5/opt/alt/python34/lib64/python3.4/asyncio/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 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)�_SSLPipea An SSL "Pipe".
An SSL pipe allows you to communicate with an SSL/TLS protocol instance
through memory buffers. It can be used to implement a security layer for an
existing connection where you don't have access to the connection's file
descriptor, or for some reason you don't want to use it.
An SSL pipe can be in "wrapped" and "unwrapped" mode. In unwrapped mode,
data is passed through untransformed. In wrapped mode, application level
data is encrypted to SSL record level data and vice versa. The SSL record
level is the lowest level in the SSL protocol suite and is what travels
as-is over the wire.
An SslPipe initially is in "unwrapped" mode. To start SSL, call
do_handshake(). To shutdown SSL again, call unwrap().
� i Nc C sj | | _ | | _ | | _ t | _ t j � | _ t j � | _ d | _ d | _
d | _ d | _ d S)a�
The *context* argument specifies the ssl.SSLContext to use.
The *server_side* argument indicates whether this is a server side or
client side transport.
The optional *server_hostname* argument can be used to specify the
hostname you are connecting to. You may only specify this parameter if
the _ssl module supports Server Name Indication (SNI).
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__C s z_SSLPipe.__init__c C s | j S)z*The SSL context passed to the constructor.)r )r"