I ran into this error when I tried to use Scamblesuit+openvpn.

File "/usr/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 586, in _doReadOrWrite
    why = selectable.doRead()
File "/usr/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 199, in doRead
    rval = self.protocol.dataReceived(data)
File "/usr/local/lib/python2.7/dist-packages/obfsproxy-0.2.7-py2.7.egg/obfsproxy/network/socks5.py", line 162, in dataReceived
File "/usr/local/lib/python2.7/dist-packages/obfsproxy-0.2.7-py2.7.egg/obfsproxy/network/socks5.py", line 234, in processAuthentication
File "/usr/local/lib/python2.7/dist-packages/obfsproxy-0.2.7-py2.7.egg/obfsproxy/network/socks5.py", line 131, in <lambda>
    (lambda self: self.processNoAuthRequired()),
File "/usr/local/lib/python2.7/dist-packages/obfsproxy-0.2.7-py2.7.egg/obfsproxy/network/socks5.py", line 320, in processNoAuthRequired
File "/usr/local/lib/python2.7/dist-packages/obfsproxy-0.2.7-py2.7.egg/obfsproxy/network/socks5.py", line 380, in processRequest
    port = msg.get_uint16(True)
File "/usr/local/lib/python2.7/dist-packages/obfsproxy-0.2.7-py2.7.egg/obfsproxy/network/socks5.py", line 507, in get_uint16
    ret = struct.unpack("!H", self[0:2])[0]
struct.error: unpack requires a string argument of length 2
2014-03-24 19:48:54,053 [DEBUG] socks_up_0xdabc30: Connection was lost (unpack requires a string argument of length 2).
2014-03-24 19:48:54,055 [DEBUG] socks_up_0xdabc30: Closing connection.

I think the length of self[0:2] is 2. Can anyone shed some light on this, thanks.

  • I am not able to reproduce this. Could you please add your OpenVPN configuration file? – Philipp Winter Mar 24 '14 at 14:50
  • This isn't a ScrambleSuit issue since it's choking in the SOCKS5 code (before ScrambleSuit enters the picture). I would need to see a hexdump of the SOCKS5 traffic to debug this. – user78 Mar 25 '14 at 7:42

This is an obfsproxy bug on systems running Python < 2.7.4.

You could try the branch linked off the tor trac entry associated with this problem or wait till obfsproxy 0.2.8.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.