carbonblack / cbfeeds

Carbon Black Feeds
Other
70 stars 31 forks source link

generate example tor feed isn't working #9

Closed snault closed 8 years ago

snault commented 8 years ago

[root@sgn-centos66-03-511 tor]# python generate_tor_feed.py example_tor_feed.feed Traceback (most recent call last): File "generate_tor_feed.py", line 98, in bytes = create() File "generate_tor_feed.py", line 69, in create nodes = get_tor_nodes() File "generate_tor_feed.py", line 20, in get_tor_nodes jsonurl = urllib.urlopen(url) File "/usr/lib64/python2.6/urllib.py", line 86, in urlopen return opener.open(url) File "/usr/lib64/python2.6/urllib.py", line 207, in open return getattr(self, name)(url) File "/usr/lib64/python2.6/urllib.py", line 441, in open_https h.endheaders() File "/usr/lib64/python2.6/httplib.py", line 930, in endheaders self._send_output() File "/usr/lib64/python2.6/httplib.py", line 802, in _send_output self.send(msg) File "/usr/lib64/python2.6/httplib.py", line 761, in send self.connect() File "/usr/lib64/python2.6/httplib.py", line 1138, in connect self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file) File "/usr/lib64/python2.6/ssl.py", line 342, in wrap_socket suppress_ragged_eofs=suppress_ragged_eofs) File "/usr/lib64/python2.6/ssl.py", line 120, in init self.do_handshake() File "/usr/lib64/python2.6/ssl.py", line 279, in do_handshake self._sslobj.do_handshake() IOError: [Errno socket error] [Errno 104] Connection reset by peer

jgarman commented 8 years ago

Hi @snault , thanks for the report.

I've tried the sample locally and it works for me. Can you try reaching the underlying web service directly using "curl" or "wget" to see what errors you may experience on the network level?

$ curl "https://onionoo.torproject.org/details?type=relay&running=true"
snault commented 8 years ago

Hi Jason,

Here’s what I get.

[root@sgn-centos-66-03-511 /]# curl https://onionoo.torproject.org/details?type=relay&running=true

[1] 4789

[root@sgn-centos-66-03-511 /]# curl: (35) SSL connect error

-Steve

From: Jason Garman [mailto:notifications@github.com] Sent: Wednesday, March 2, 2016 2:02 PM To: carbonblack/cbfeeds cbfeeds@noreply.github.com Cc: Steven Nault snault@bit9.com Subject: Re: [cbfeeds] generate example tor feed isn't working (#9)

Hi @snault https://github.com/snault , thanks for the report.

I've tried the sample locally and it works for me. Can you try reaching the underlying web service directly using "curl" or "wget" to see what errors you may experience on the network level?

$ curl "https://onionoo.torproject.org/details?type=relay https://onionoo.torproject.org/details?type=relay&running=true &running=true"

— Reply to this email directly or view it on GitHub https://github.com/carbonblack/cbfeeds/issues/9#issuecomment-191374196 . https://github.com/notifications/beacon/AQAHhnOkAAHaCkCNszIJ6Hb0VGq2OEuOks5ppd6rgaJpZM4Hnu3B.gif

snault commented 8 years ago

Hi,

Tried wget as well.

[root@sgn-centos-66-03-511 /]# wget https://onionoo.torproject.org/details?type=relay&running=true

[1] 5055

[root@sgn-centos-66-03-511 /]# --2016-03-02 13:08:04-- https://onionoo.torproject.org/details?type=relay

Resolving onionoo.torproject.org... 154.35.132.148, 2607:8500:5:1::e178

Connecting to onionoo.torproject.org|154.35.132.148|:443... connected.

Unable to establish SSL connection.

-Steve

From: Jason Garman [mailto:notifications@github.com] Sent: Wednesday, March 2, 2016 2:02 PM To: carbonblack/cbfeeds cbfeeds@noreply.github.com Cc: Steven Nault snault@bit9.com Subject: Re: [cbfeeds] generate example tor feed isn't working (#9)

Hi @snault https://github.com/snault , thanks for the report.

I've tried the sample locally and it works for me. Can you try reaching the underlying web service directly using "curl" or "wget" to see what errors you may experience on the network level?

$ curl "https://onionoo.torproject.org/details?type=relay https://onionoo.torproject.org/details?type=relay&running=true &running=true"

— Reply to this email directly or view it on GitHub https://github.com/carbonblack/cbfeeds/issues/9#issuecomment-191374196 . https://github.com/notifications/beacon/AQAHhnOkAAHaCkCNszIJ6Hb0VGq2OEuOks5ppd6rgaJpZM4Hnu3B.gif

jgarman commented 8 years ago

You need the quotes around the URL to make sure the "&" is not interpreted by your shell, try cutting and pasting the command exactly (without the leading "$" indicating your shell prompt).

Since curl also gives an SSL handshake error, then this is a network issue and not related to the example code. You'll have to ask your network administrator/ISP whether there are any proxies or transparent SSL interception/MITM appliances in between your host and the onionoo.torproject.org server.