Opened 6 years ago

Closed 5 years ago

#8366 closed enhancement (worksforme)

ooni: should be able to take hostnames as arguments

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


From #8353, aagbsn requests implementing support for hostnames as arguments to Because implementing DNS resolution in this test is a whole separate task, I'm making this it's own ticket.

Child Tickets

Change History (3)

comment:1 Changed 6 years ago by isis

Status: newaccepted

A traceback with an unhandled error is generated when attempting to run with a hostname rather than an IP address is not handled correctly. So, regardless of whether or not we are going to implement hostname lookup in the test, we should at least handle this error and exit gracefully:

(ooni)?!isis?wintermute:~/code/torproject/ooni-probe ? bin/ooniprobe -n nettests/experimental/ -h
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 torproject
Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x2c6d440>
Found your IP via a GeoIP service:
[D] adding callback for startNetTest
[D] Creating ./report-tls-handshake-2013-05-09T095553Z.yamloo
[D] Writing report with YAML reporter
[D] Created report with <ooni.reporter.YAMLReporter object at 0x2c6f050>
[D] Starting this task <generator object generateMeasurements at 0x2c73370>
[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
[D] Checking all tasks for completion 0 == 1
[!] Connection failed with reason: [Failure instance: Traceback: <type 'exceptions.ValueError'>: '' does not appear to be an IPv4 or IPv6 address
--- <exception caught here> ---
Handshake with failed!
Handshake failed with reason: Socket '' does not appear to be an IPv4 or IPv6 address
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 525, in __bootstrap
  File "/usr/lib/python2.7/", line 552, in __bootstrap_inner
  File "/usr/lib/python2.7/", line 505, in run
    self.__target(*self.__args, **self.__kwargs)
--- <exception caught here> ---
  File "/home/isis/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/python/", line 172, in _worker
    result =, function, *args, **kwargs)
  File "/home/isis/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/python/", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/home/isis/.virtualenvs/ooni/local/lib/python2.7/site-packages/twisted/python/", line 81, in callWithContext
    return func(*args,**kw)
  File "/home/isis/code/torproject/ooni-probe/nettests/experimental/", line 312, in makeConnection
    sckt = self.buildSocket(addr)
  File "/home/isis/code/torproject/ooni-probe/nettests/experimental/", line 217, in buildSocket
    ip = ipaddr.IPAddress(addr) ## learn if we're IPv4 or IPv6
  File "/home/isis/.virtualenvs/ooni/local/lib/python2.7/site-packages/", line 78, in IPAddress
exceptions.ValueError: '' does not appear to be an IPv4 or IPv6 address

[D] connectionShutdown: got NoneType for connection
Successfully completed measurement: <ooni.tasks.Measurement object at 0x2c6f350>
[D] Starting this task <ooni.tasks.ReportEntry object at 0x2d24410>
[D] Writing report with YAML reporter
[D] Successfully performed report <ooni.tasks.ReportEntry object at 0x2d24410>
[D] None
[D] Checking all tasks for completion 1 == 1
[D] Halting reactor
[D] Successfully performed measurement <ooni.tasks.Measurement object at 0x2c6f350>
[D] None
Stopping factory <twisted.web.client._HTTP11ClientFactory instance at 0x2c6d440>
Main loop terminated.

I'm not sure if this should be a separate bug or not, but since it's related it seemed it should go here.

comment:2 Changed 6 years ago by isis

Status: acceptedneeds_revision

comment:3 Changed 5 years ago by isis

Resolution: worksforme
Status: needs_revisionclosed
Note: See TracTickets for help on using tickets.