Changeset 121


Ignore:
Timestamp:
03/01/17 19:18:02 (8 years ago)
Author:
tim
Message:

.

File:
1 edited

Legend:

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

    r120 r121  
    7777
    7878
    79 def ConnectSSLTLS(host, port, cipher_list=None, handshake_callback=None):
     79def ConnectSSLTLS(host, port, cipher_list=None, handshake_callback=None, verbose=True):
    8080    protocols = [("SSL 2/3", SSL.SSLv23_METHOD),
    8181                 ("TLS 1.0", SSL.TLSv1_METHOD),
     
    102102            break
    103103        except ValueError as e:
    104             sys.stderr.write("%s protocol not supported by your openssl library, trying others...\n" % pname)
     104            if verbose:
     105                sys.stderr.write("%s protocol not supported by your openssl library, trying others...\n" % pname)
    105106        except SSL.Error as e:
    106             sys.stderr.write("Exception during %s handshake with server." % pname)
    107             sys.stderr.write("\nThis could happen because the server requires "
    108                              "certain SSL/TLS versions or a client certificiate."
    109                              "  Have no fear, we'll keep trying...\n")           
     107            if verbose:
     108                sys.stderr.write("Exception during %s handshake with server." % pname)
     109                sys.stderr.write("\nThis could happen because the server requires "
     110                                 "certain SSL/TLS versions or a client certificiate."
     111                                 "  Have no fear, we'll keep trying...\n")           
    110112        except Exception as e:
    111             sys.stderr.write("Unknown exception during handshake with server: \n")
     113            sys.stderr.write("Unknown exception during %s handshake with server: \n" % pname)
    112114            traceback.print_exc(file=sys.stderr)
    113115
Note: See TracChangeset for help on using the changeset viewer.