Changeset 115 for trunk/lib


Ignore:
Timestamp:
10/06/16 21:10:15 (8 years ago)
Author:
tim
Message:

256 color now default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bletchley/ssltls.py

    r110 r115  
    4545    context = SSL.Context(method)
    4646    context.set_verify(SSL.VERIFY_NONE, (lambda a,b,c,d,e: True))
     47
    4748    if key and len(certChain) > 0:
    4849        context.use_privatekey(key)
     
    5455
    5556
    56 def startSSLTLS(sock, mode='client', handshake=SSL.TLSv1_METHOD, key=None, certChain=[]):
    57     conn = SSL.Connection(createContext(handshake, key=key, certChain=certChain), sock)
     57def startSSLTLS(sock, mode='client', handshake=SSL.TLSv1_METHOD, key=None, certChain=[], cipher_list=None):
     58    '''
     59    cipher_list example:  b'DH-DSS-AES256-GCM-SHA384:DHE-DSS-AES256-GCM-SHA384:DH-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA256:DH-RSA-AES256-SHA256:DH-DSS-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DH-RSA-AES256-SHA:DH-DSS-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-DSS-CAMELLIA256-SHA:DH-RSA-CAMELLIA256-SHA:DH-DSS-CAMELLIA256-SHA:ADH-AES256-GCM-SHA384:ADH-AES256-SHA256:ADH-AES256-SHA:ADH-CAMELLIA256-SHA:DH-DSS-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:DH-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-DSS-AES128-SHA256:DH-RSA-AES128-SHA256:DH-DSS-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:DH-RSA-AES128-SHA:DH-DSS-AES128-SHA:DHE-RSA-SEED-SHA:DHE-DSS-SEED-SHA:DH-RSA-SEED-SHA:DH-DSS-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:DHE-DSS-CAMELLIA128-SHA:DH-RSA-CAMELLIA128-SHA:DH-DSS-CAMELLIA128-SHA:ADH-AES128-GCM-SHA256:ADH-AES128-SHA256:ADH-AES128-SHA:ADH-SEED-SHA:ADH-CAMELLIA128-SHA:ADH-RC4-MD5:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DH-RSA-DES-CBC3-SHA:DH-DSS-DES-CBC3-SHA:ADH-DES-CBC3-SHA'
     60    '''
     61   
     62    context = createContext(handshake, key=key, certChain=certChain)
     63    if cipher_list:
     64        context.set_cipher_list(cipher_list)
     65    #if not key and mode == 'server':
     66    #context.set_options(OpenSSL.SSL.OP_SINGLE_DH_USE)
     67    #context.set_options(OpenSSL.SSL.OP_EPHEMERAL_RSA)
     68       
     69    conn = SSL.Connection(context, sock)
    5870    if mode == 'client':
    5971        conn.set_connect_state()
Note: See TracChangeset for help on using the changeset viewer.