def optionsForClientTLS(hostname, trustRoot=None, clientCertificate=None, acceptableProtocols=None, **kw):
 extraCertificateOptions = (kw.pop('extraCertificateOptions', None) or {})
 if (trustRoot is None):
  trustRoot = platformTrust()
 if kw:
  raise TypeError("optionsForClientTLS() got an unexpected keyword argument '{arg}'".format(arg=kw.popitem()[0]))
 if (not isinstance(hostname, unicode)):
  raise TypeError(('optionsForClientTLS requires text for host names, not ' + hostname.__class__.__name__))
 if clientCertificate:
  extraCertificateOptions.update(privateKey=clientCertificate.privateKey.original, certificate=clientCertificate.original)
 certificateOptions = OpenSSLCertificateOptions(trustRoot=trustRoot, acceptableProtocols=acceptableProtocols, **extraCertificateOptions)
 return ClientTLSOptions(hostname, certificateOptions.getContext())

def optionsForClientTLS ( hostname , trustRoot = None , clientCertificate = None , acceptableProtocols = None , ** kw ) : extraCertificateOptions = ( kw . pop ( 'extraCertificateOptions' , None ) or { } ) if ( trustRoot is None ) : trustRoot = platformTrust ( ) if kw : raise TypeError ( "optionsForClientTLS() got an unexpected keyword argument '{arg}'" . format ( arg = kw . popitem ( ) [ 0 ] ) ) if ( not isinstance ( hostname , unicode ) ) : raise TypeError ( ( 'optionsForClientTLS requires text for host names, not ' + hostname . __class__ . __name__ ) ) if clientCertificate : extraCertificateOptions . update ( privateKey = clientCertificate . privateKey . original , certificate = clientCertificate . original ) certificateOptions = OpenSSLCertificateOptions ( trustRoot = trustRoot , acceptableProtocols = acceptableProtocols , ** extraCertificateOptions ) return ClientTLSOptions ( hostname , certificateOptions . getContext ( ) )
create a l{client connection creator <iopensslclientconnectioncreator>} for use with apis such as l{ssl4clientendpoint <twisted .