#NEWLINE# def starttls( self , callback = None , **options ) : #NEWLINE# #INDENT# 'Begin TLS negotiation; options are passed through to\n        do_handshake().  If callback is given, it is called after a\n        successful negotiation.' #NEWLINE# if self . _wb : #NEWLINE# #INDENT# self . _write_callback = partial ( self . starttls , callback , ** options ) #NEWLINE# return #NEWLINE# #UNINDENT# def success( socket ) : #NEWLINE# #INDENT# self . socket = socket #NEWLINE# self . io . add_handler ( socket . fileno ( ) , self . _handle , self . _state ) #NEWLINE# ( callback and callback ( ) ) #NEWLINE# #UNINDENT# def failure( socket ) : #NEWLINE# #INDENT# self . socket = socket #NEWLINE# self . close ( ) #NEWLINE# #UNINDENT# aio . starttls ( self . socket , success , failure , self . io , ** options ) #NEWLINE# self . socket = None