Opened 7 years ago

Closed 6 years ago

#8360 closed defect (fixed)

ooni: tls_handshake.py does not properly handle socket timeouts

Reported by: isis Owned by: isis
Priority: Medium Milestone:
Component: Archived/Ooni Version:
Severity: Keywords: ooni, bugreport
Cc: hellais, ioerror, aagbsn, isis Actual Points:
Parent ID: #8353 Points:
Reviewer: Sponsor:

Description

[!] [Failure instance: Traceback: <class 'socket.timeout'>: timed out
/home/isis/code/torproject/ooni-probe/ooni/runner.py:233:runTestCasesWithInput
/home/isis/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py:134:maybeDeferred
/home/isis/code/torproject/ooni-probe/nettests/experimental/tls_handshake.py:652:test_tlsv1_handshake
/home/isis/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py:1187:unwindGenerator
--- <exception caught here> ---
/home/isis/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/internet/defer.py:1045:_inlineCallbacks
/home/isis/code/torproject/ooni-probe/nettests/experimental/tls_handshake.py:644:deferMakeConnection
/home/isis/code/torproject/ooni-probe/nettests/experimental/tls_handshake.py:268:makeConnection
/usr/lib/python2.7/socket.py:224:meth
]

Child Tickets

Change History (2)

comment:1 Changed 7 years ago by isis

Status: newneeds_review

This is fixed in commit 57dee7ac34ccce00becdd2e0f770b2a3990f3fe9 in feature/tls-handshake-rebased.

comment:2 Changed 6 years ago by isis

Resolution: fixed
Status: needs_reviewclosed

This was merged into master in commit 875dc22d85d8391b81f6fe988f080a2cb41d65e3.

The output on stdout for a run of tls_handshake.py shows that socket errors (including timeouts) are logged:

(ooni)?!isis?wintermute:~/code/torproject/ooni-probe ? bin/ooniprobe -n nettests/experimental/tls_handshake.py -f private/lists/tor-bridges.fake
Log opened.
Not reporting using a collector
[D] No test deck detected
[D] Tor is not running. Skipping IP lookup via Tor.
[D] Cannot determine the probe IP address with a traceroute, becase of insufficient priviledges
Looking up your IP address via maxmind
Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x1a02050>
Found your IP via a GeoIP service: 108.185.38.73
[D] adding callback for startNetTest
[D] Creating ./report-tls-handshake-2013-05-09T092512Z.yamloo
[D] Writing report with YAML reporter
[D] Created report with <ooni.reporter.YAMLReporter object at 0x1a04090>
[D] Starting this task <generator object generateMeasurements at 0x1a073c0>
[D] Running <class 'nettests.experimental.tls_handshake.HandshakeTest'> test_handshake
[!] No SSL/TLS context chosen! Defaulting to TLSv1.
Using default Firefox ciphersuite list.
Beginning handshake test for 85.10.205.21:18391
[D] Running <class 'nettests.experimental.tls_handshake.HandshakeTest'> test_handshake
[!] No SSL/TLS context chosen! Defaulting to TLSv1.
Using default Firefox ciphersuite list.
Beginning handshake test for 54.242.208.158:443
[D] Running <class 'nettests.experimental.tls_handshake.HandshakeTest'> test_handshake
[!] No SSL/TLS context chosen! Defaulting to TLSv1.
Using default Firefox ciphersuite list.
Beginning handshake test for 85.193.252.111:443
[D] Running <class 'nettests.experimental.tls_handshake.HandshakeTest'> test_handshake
[!] No SSL/TLS context chosen! Defaulting to TLSv1.
Using default Firefox ciphersuite list.
Beginning handshake test for 68.98.41.14:9001
[D] Checking all tasks for completion 0 == 4
Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x1a02050>
Connected to 85.10.205.21
[D] Connection state: before/connect initialization
Attempting handshake: 85.10.205.21
Handshake with 85.10.205.21:18391 successful!
Server certificate:

-----BEGIN CERTIFICATE-----
MIIBuzCCASSgAwIBAgIJAL4rWvMuHTPLMA0GCSqGSIb3DQEBBQUAMB4xHDAaBgNV
BAMTE3d3dy52bTZqd2c2eWlwbC5jb20wHhcNMTMwNTA5MDc1OTM2WhcNMTQwNTA5
MDc1OTM2WjAhMR8wHQYDVQQDExZ3d3cucXVwNXo3c2l1bjVkNWQubmV0MIGfMA0G
CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDj1fP4mzkquto0iVUVsn5MPF6ewXswyqPQ
LTCGAjiIo6CBIyK4J7DmfmarKb29d9TtVxB11vBtqJ5ouoqdRzq5ynBXX2a2U801
6lzAFCwMJYF8chvMVo5wOBmAuxYJJ2z5XzfrOfaXd5F0SWCu0flmJFdhCcJM6C0I
YWeTiBRrTwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAAyQ8NeTV3XlLnKI5nULop6t
hvov4o08EzhNZbtQlcoEDadoMQZAGkgX94ycWE2dl2mNsZHsHKio9I5WKoN316+T
0Xdvkel9WWNyLNX3lY1mU0OFQc6lKZfL7o1JXvNBhrcjayuShJQHuqNFRxFkqDnG
LAKADOeM2EkG7eXj8GPg
-----END CERTIFICATE-----

Server certificate chain:

-----BEGIN CERTIFICATE-----
MIIBuzCCASSgAwIBAgIJAL4rWvMuHTPLMA0GCSqGSIb3DQEBBQUAMB4xHDAaBgNV
BAMTE3d3dy52bTZqd2c2eWlwbC5jb20wHhcNMTMwNTA5MDc1OTM2WhcNMTQwNTA5
MDc1OTM2WjAhMR8wHQYDVQQDExZ3d3cucXVwNXo3c2l1bjVkNWQubmV0MIGfMA0G
CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDj1fP4mzkquto0iVUVsn5MPF6ewXswyqPQ
LTCGAjiIo6CBIyK4J7DmfmarKb29d9TtVxB11vBtqJ5ouoqdRzq5ynBXX2a2U801
6lzAFCwMJYF8chvMVo5wOBmAuxYJJ2z5XzfrOfaXd5F0SWCu0flmJFdhCcJM6C0I
YWeTiBRrTwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAAyQ8NeTV3XlLnKI5nULop6t
hvov4o08EzhNZbtQlcoEDadoMQZAGkgX94ycWE2dl2mNsZHsHKio9I5WKoN316+T
0Xdvkel9WWNyLNX3lY1mU0OFQc6lKZfL7o1JXvNBhrcjayuShJQHuqNFRxFkqDnG
LAKADOeM2EkG7eXj8GPg
-----END CERTIFICATE-----

Negotiated ciphersuite:
ECDHE-ECDSA-AES256-SHA
        ECDHE-RSA-AES256-SHA
        DHE-RSA-CAMELLIA256-SHA
        DHE-DSS-CAMELLIA256-SHA
        DHE-RSA-AES256-SHA
        DHE-DSS-AES256-SHA
        CAMELLIA256-SHA
        AES256-SHA
        ECDHE-ECDSA-RC4-SHA
        ECDHE-ECDSA-AES128-SHA
        ECDHE-RSA-RC4-SHA
        ECDHE-RSA-AES128-SHA
        DHE-RSA-CAMELLIA128-SHA
        DHE-DSS-CAMELLIA128-SHA
Certificate subject: [('CN', 'www.qup5z7siun5d5d.net')]
Certificate subject hash: 1110666974
Certificate issuer: [('CN', 'www.vm6jwg6yipl.com')]
Certificate public key:

-----BEGIN PRIVATE KEY-----
MIGkAgEAMA0GCSqGSIb3DQEBAQUABIGPMIGMAgEAAoGBAOPV8/ibOSq62jSJVRWy
fkw8Xp7BezDKo9AtMIYCOIijoIEjIrgnsOZ+Zqspvb131O1XEHXW8G2onmi6ip1H
OrnKcFdfZrZTzTXqXMAULAwlgXxyG8xWjnA4GYC7FgknbPlfN+s59pd3kXRJYK7R
+WYkV2EJwkzoLQhhZ5OIFGtPAgMBAAE=
-----END PRIVATE KEY-----

Certificate signature algorithm: sha1WithRSAEncryption
Certificate serial number: 13703146291702084555
Total renegotiations: 0
[D] connectionShutdown: got NoneType for connection
None
Successfully completed measurement: <ooni.tasks.Measurement object at 0x1a04290>
[D] Starting this task <ooni.tasks.ReportEntry object at 0x1a0ce90>
[D] Writing report with YAML reporter
[D] Successfully performed report <ooni.tasks.ReportEntry object at 0x1a0ce90>
[D] None
[D] Checking all tasks for completion 1 == 4
[D] Successfully performed measurement <ooni.tasks.Measurement object at 0x1a04290>
[D] None
^CReceived SIGINT, shutting down.
Main loop terminated.
(ooni)?!isis?wintermute:~/code/torproject/ooni-probe ? bin/ooniprobe -n nettests/experimental/tls_handshake.py -f private/lists/tor-bridges.fake
Log opened.
Not reporting using a collector
[D] No test deck detected
[D] Tor is not running. Skipping IP lookup via Tor.
[D] Cannot determine the probe IP address with a traceroute, becase of insufficient priviledges
Looking up your IP address via ubuntu
Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x2e7e050>
Found your IP via a GeoIP service: 108.185.38.73
[D] adding callback for startNetTest
[D] Creating ./report-tls-handshake-2013-05-09T092618Z.yamloo
[D] Writing report with YAML reporter
[D] Created report with <ooni.reporter.YAMLReporter object at 0x2e80090>
[D] Starting this task <generator object generateMeasurements at 0x2e83370>
[D] Running <class 'nettests.experimental.tls_handshake.HandshakeTest'> test_handshake
[!] No SSL/TLS context chosen! Defaulting to TLSv1.
Using default Firefox ciphersuite list.
Beginning handshake test for 85.10.205.21:18391
[D] Running <class 'nettests.experimental.tls_handshake.HandshakeTest'> test_handshake
[!] No SSL/TLS context chosen! Defaulting to TLSv1.
Using default Firefox ciphersuite list.
Beginning handshake test for 54.242.208.158:443
[D] Running <class 'nettests.experimental.tls_handshake.HandshakeTest'> test_handshake
[!] No SSL/TLS context chosen! Defaulting to TLSv1.
Using default Firefox ciphersuite list.
Beginning handshake test for 85.193.252.111:443
[D] Running <class 'nettests.experimental.tls_handshake.HandshakeTest'> test_handshake
[!] No SSL/TLS context chosen! Defaulting to TLSv1.
Using default Firefox ciphersuite list.
Beginning handshake test for 68.98.41.14:9001
[D] Checking all tasks for completion 0 == 4
Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x2e7e050>
Connected to 85.10.205.21
[D] Connection state: before/connect initialization
Attempting handshake: 85.10.205.21
Handshake with 85.10.205.21:18391 successful!
Server certificate:

-----BEGIN CERTIFICATE-----
MIIBuzCCASSgAwIBAgIJAL4rWvMuHTPLMA0GCSqGSIb3DQEBBQUAMB4xHDAaBgNV
BAMTE3d3dy52bTZqd2c2eWlwbC5jb20wHhcNMTMwNTA5MDc1OTM2WhcNMTQwNTA5
MDc1OTM2WjAhMR8wHQYDVQQDExZ3d3cucXVwNXo3c2l1bjVkNWQubmV0MIGfMA0G
CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDj1fP4mzkquto0iVUVsn5MPF6ewXswyqPQ
LTCGAjiIo6CBIyK4J7DmfmarKb29d9TtVxB11vBtqJ5ouoqdRzq5ynBXX2a2U801
6lzAFCwMJYF8chvMVo5wOBmAuxYJJ2z5XzfrOfaXd5F0SWCu0flmJFdhCcJM6C0I
YWeTiBRrTwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAAyQ8NeTV3XlLnKI5nULop6t
hvov4o08EzhNZbtQlcoEDadoMQZAGkgX94ycWE2dl2mNsZHsHKio9I5WKoN316+T
0Xdvkel9WWNyLNX3lY1mU0OFQc6lKZfL7o1JXvNBhrcjayuShJQHuqNFRxFkqDnG
LAKADOeM2EkG7eXj8GPg
-----END CERTIFICATE-----

Server certificate chain:

-----BEGIN CERTIFICATE-----
MIIBuzCCASSgAwIBAgIJAL4rWvMuHTPLMA0GCSqGSIb3DQEBBQUAMB4xHDAaBgNV
BAMTE3d3dy52bTZqd2c2eWlwbC5jb20wHhcNMTMwNTA5MDc1OTM2WhcNMTQwNTA5
MDc1OTM2WjAhMR8wHQYDVQQDExZ3d3cucXVwNXo3c2l1bjVkNWQubmV0MIGfMA0G
CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDj1fP4mzkquto0iVUVsn5MPF6ewXswyqPQ
LTCGAjiIo6CBIyK4J7DmfmarKb29d9TtVxB11vBtqJ5ouoqdRzq5ynBXX2a2U801
6lzAFCwMJYF8chvMVo5wOBmAuxYJJ2z5XzfrOfaXd5F0SWCu0flmJFdhCcJM6C0I
YWeTiBRrTwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAAyQ8NeTV3XlLnKI5nULop6t
hvov4o08EzhNZbtQlcoEDadoMQZAGkgX94ycWE2dl2mNsZHsHKio9I5WKoN316+T
0Xdvkel9WWNyLNX3lY1mU0OFQc6lKZfL7o1JXvNBhrcjayuShJQHuqNFRxFkqDnG
LAKADOeM2EkG7eXj8GPg
-----END CERTIFICATE-----

Negotiated ciphersuite:
ECDHE-ECDSA-AES256-SHA
        ECDHE-RSA-AES256-SHA
        DHE-RSA-CAMELLIA256-SHA
        DHE-DSS-CAMELLIA256-SHA
        DHE-RSA-AES256-SHA
        DHE-DSS-AES256-SHA
        CAMELLIA256-SHA
        AES256-SHA
        ECDHE-ECDSA-RC4-SHA
        ECDHE-ECDSA-AES128-SHA
        ECDHE-RSA-RC4-SHA
        ECDHE-RSA-AES128-SHA
        DHE-RSA-CAMELLIA128-SHA
        DHE-DSS-CAMELLIA128-SHA
Certificate subject: [('CN', 'www.qup5z7siun5d5d.net')]
Certificate subject hash: 1110666974
Certificate issuer: [('CN', 'www.vm6jwg6yipl.com')]
Certificate public key:

-----BEGIN PRIVATE KEY-----
MIGkAgEAMA0GCSqGSIb3DQEBAQUABIGPMIGMAgEAAoGBAOPV8/ibOSq62jSJVRWy
fkw8Xp7BezDKo9AtMIYCOIijoIEjIrgnsOZ+Zqspvb131O1XEHXW8G2onmi6ip1H
OrnKcFdfZrZTzTXqXMAULAwlgXxyG8xWjnA4GYC7FgknbPlfN+s59pd3kXRJYK7R
+WYkV2EJwkzoLQhhZ5OIFGtPAgMBAAE=
-----END PRIVATE KEY-----

Certificate signature algorithm: sha1WithRSAEncryption
Certificate serial number: 13703146291702084555
Total renegotiations: 0
[D] connectionShutdown: got NoneType for connection
None
Successfully completed measurement: <ooni.tasks.Measurement object at 0x2e80a10>
[D] Starting this task <ooni.tasks.ReportEntry object at 0x2e85e50>
[D] Writing report with YAML reporter
[D] Successfully performed report <ooni.tasks.ReportEntry object at 0x2e85e50>
[D] None
[D] Checking all tasks for completion 1 == 4
[D] Successfully performed measurement <ooni.tasks.Measurement object at 0x2e80a10>
[D] None
[!] Connection failed with reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.defer.CancelledError'>:
]
Handshake with 54.242.208.158:443 failed!
Handshake failed with reason: Socket
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
Failure: twisted.internet.defer.CancelledError:

[D] connectionShutdown: got NoneType for connection
None
Successfully completed measurement: <ooni.tasks.Measurement object at 0x2e80b50>
[D] Starting this task <ooni.tasks.ReportEntry object at 0x2e85e10>
[D] Writing report with YAML reporter
[D] Successfully performed report <ooni.tasks.ReportEntry object at 0x2e85e10>
[D] None
[D] Checking all tasks for completion 2 == 4
[D] Successfully performed measurement <ooni.tasks.Measurement object at 0x2e80b50>
[D] None
[!] Connection failed with reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.defer.CancelledError'>:
]
Handshake with 85.193.252.111:443 failed!
Handshake failed with reason: Socket
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
Failure: twisted.internet.defer.CancelledError:

[D] connectionShutdown: got NoneType for connection
None
Successfully completed measurement: <ooni.tasks.Measurement object at 0x2e85190>
[D] Starting this task <ooni.tasks.ReportEntry object at 0x2e85fd0>
[D] Writing report with YAML reporter
[D] Successfully performed report <ooni.tasks.ReportEntry object at 0x2e85fd0>
[D] None
[!] Connection failed with reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.defer.CancelledError'>:
]
Handshake with 68.98.41.14:9001 failed!
Handshake failed with reason: Socket
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
Failure: twisted.internet.defer.CancelledError:

[D] connectionShutdown: got NoneType for connection
None
Successfully completed measurement: <ooni.tasks.Measurement object at 0x2e85790>
[D] Starting this task <ooni.tasks.ReportEntry object at 0x2e85f50>
[D] Writing report with YAML reporter
[D] Successfully performed report <ooni.tasks.ReportEntry object at 0x2e85f50>
[D] None
[D] Checking all tasks for completion 4 == 4
[D] Halting reactor
[D] Successfully performed measurement <ooni.tasks.Measurement object at 0x2e85790>
[D] None
Main loop terminated.
Note: See TracTickets for help on using tickets.