von / PerProxy

A python-based proxy that uses Perspectives to detect and thwart SSL MITM attacks.
7 stars 2 forks source link

Need to handle SSL errors connecting to server #21

Open von opened 13 years ago

von commented 13 years ago
PerProxy:Thread-84:maps.google.com: Error connecting to maps.google.com:443: Peer certificate commonName does not match host, expected maps.google.com, got www.google.com
PerProxy:Thread-84:maps.google.com: Peer certificate commonName does not match host, expected maps.google.com, got www.google.com
Traceback (most recent call last):
  File "./PerProxy.py", line 60, in handle
    server = self.connect_to_server(hostname, port)
  File "./PerProxy.py", line 115, in connect_to_server
    server = Server(hostname, port)
  File "/Users/vwelch/develop/PerProxy-master/Server.py", line 23, in **init**
    self.sock.connect((hostname, port))
  File "build/bdist.macosx-10.3-fat/egg/M2Crypto/SSL/Connection.py", line 182, in connect
    if not check(self.get_peer_cert(), self.addr[0]):
  File "build/bdist.macosx-10.3-fat/egg/M2Crypto/SSL/Checker.py", line 123, in **call**
    fieldName='commonName')
WrongHost: Peer certificate commonName does not match host, expected maps.google.com, got www.google.com
PerProxy:Thread-84:maps.google.com: Deferring handling error connecting to server: Peer certificate commonName does not match host, expected maps.google.com, got www.google.com
PerProxy:Thread-84:maps.google.com: Responding to client.
PerProxy:Thread-84:maps.google.com: Cert = /var/folders/q7/q71vne3DHjGGpRIbI1PBWk+++TQ/-Tmp-/tmpC_y656
PerProxy:Thread-84:maps.google.com: Key = /var/folders/q7/q71vne3DHjGGpRIbI1PBWk+++TQ/-Tmp-/tmp5Btccz
von commented 13 years ago

Actually, we don't need to be doing any checking of the certificate on the server side of the proxy at all, that's what Perspectives is for. See http://stackoverflow.com/questions/2328265/turn-sslchecking-off-in-m2crypto-in-python