<s> from twisted . internet import ssl , task , protocol , endpoints , defer <EOL> from twisted . python . modules import getModule <EOL> import echoclient <EOL> @ defer . inlineCallbacks <EOL> def main ( reactor ) : <EOL> factory = protocol . Factory . forProtocol ( echoclient . EchoClient ) <EOL> certData = getModule ( __name__ ) . filePath . sibling ( '<STR_LIT>' ) . getContent ( ) <EOL> authority = ssl . Certificate . loadPEM ( certData ) <EOL> options = ssl . optionsForClientTLS ( u'<STR_LIT>' , authority ) <EOL> endpoint = endpoints . SSL4ClientEndpoint ( reactor , '<STR_LIT:localhost>' , <NUM_LIT> , <EOL> options ) <EOL> echoClient = yield endpoint . connect ( factory ) <EOL> done = defer . Deferred ( ) <EOL> echoClient . connectionLost = lambda reason : done . callback ( None ) <EOL> yield done <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> import echoclient_ssl <EOL> task . react ( echoclient_ssl . main ) </s>
