#NEWLINE# def _command_STARTTLS( self , arg ) : #NEWLINE# #INDENT# if ( 'STARTTLS' not in self . extensions ) : #NEWLINE# #INDENT# unknown_command . send ( self . io ) #NEWLINE# return #NEWLINE# #UNINDENT# if arg : #NEWLINE# #INDENT# bad_arguments . send ( self . io ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( not self . ehlo_as ) : #NEWLINE# #INDENT# bad_sequence . send ( self . io ) #NEWLINE# return #NEWLINE# #UNINDENT# reply = Reply ( '220' , '2.7.0 Go ahead' ) #NEWLINE# self . _call_custom_handler ( 'STARTTLS' , reply , self . extensions ) #NEWLINE# reply . send ( self . io , flush = True ) #NEWLINE# self . _check_close_code ( reply ) #NEWLINE# if ( reply . code == '220' ) : #NEWLINE# #INDENT# if ( not self . _encrypt_session ( ) ) : #NEWLINE# #INDENT# tls_failure . send ( self . io ) #NEWLINE# raise StopIteration ( ) #NEWLINE# #UNINDENT# self . ehlo_as = None #NEWLINE# self . extensions . drop ( 'STARTTLS' )