def _expandCipherString(cipherString, method, options):
 ctx = SSL.Context(method)
 ctx.set_options(options)
 try:
  ctx.set_cipher_list(cipherString.encode('ascii'))
 except SSL.Error as e:
  if (e.args[0][0][2] == 'no cipher match'):
   return []
  else:
   raise
 conn = SSL.Connection(ctx, None)
 ciphers = conn.get_cipher_list()
 if isinstance(ciphers[0], unicode):
  return [OpenSSLCipher(cipher) for cipher in ciphers]
 else:
  return [OpenSSLCipher(cipher.decode('ascii')) for cipher in ciphers]

def _expandCipherString ( cipherString , method , options ) : ctx = SSL . Context ( method ) ctx . set_options ( options ) try : ctx . set_cipher_list ( cipherString . encode ( 'ascii' ) ) except SSL . Error as e : if ( e . args [ 0 ] [ 0 ] [ 2 ] == 'no cipher match' ) : return [ ] else : raise conn = SSL . Connection ( ctx , None ) ciphers = conn . get_cipher_list ( ) if isinstance ( ciphers [ 0 ] , unicode ) : return [ OpenSSLCipher ( cipher ) for cipher in ciphers ] else : return [ OpenSSLCipher ( cipher . decode ( 'ascii' ) ) for cipher in ciphers ]
expand c{cipherstring} according to c{method} and c{options} to a list of explicit ciphers that are supported by the current platform .