Changeset 74 for trunk/bin/bletchley-clonecertchain
- Timestamp:
- 11/13/14 19:39:07 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/bletchley-clonecertchain
r73 r74 64 64 serverSock.connect((host,port)) 65 65 66 chain = None 66 67 try: 67 68 server = SSL.Connection(createClientContext(), serverSock) … … 69 70 server.do_handshake() 70 71 except Exception as e: 71 print("Exception during handshake with server: ") 72 traceback.print_exc(e) 73 return None 72 sys.stderr.write("Exception during handshake with server: \n") 73 traceback.print_exc(file=sys.stderr) 74 sys.stderr.write("\nThis typically occurs when server rejects our " 75 "connection due to lack of a client certificate or" 76 " for similar reasons.\nAttempting to continue...\n\n") 74 77 75 78 return server.get_peer_cert_chain() … … 221 224 222 225 #print("FAKE KEY AND CHAIN:") 226 if not chain: 227 sys.stderr.write("ERROR: Could not retrieve server certificate\n\n") 228 sys.exit(2) 229 223 230 fake_key, fake_chain = genFakeCertificateChain(chain) 224 231 print(OpenSSL.crypto.dump_privatekey(OpenSSL.crypto.FILETYPE_PEM, fake_key).decode('utf-8'))
Note: See TracChangeset
for help on using the changeset viewer.