namecoin / Convergence

Secure peer-to-peer DNS resolution and HTTPS authentication for Firefox, without certificate authorities, using the Namecoin blockchain. This repo is deprecated in favor of https://github.com/namecoin/ncdns and https://github.com/namecoin/dns-prop279
https://bit.namecoin.org/freespeechme.html
27 stars 26 forks source link

Initial XULRunner Support #5

Closed JeremyRand closed 9 years ago

JeremyRand commented 10 years ago

make now generates a XULRunner application as well as a Firefox extension. The XULRunner application works for me, although it has a few bugs and is definitely not ready for production use.

BETA TESTERS: The main feature that we need tested is HTTPS .bit websites with the standalone proxy. Two known sites are https://dot-bit.bit/ and https://www.freespeechme.bit/ . Please let us know if these work once the TLS installation script has been executed. (Windows, Ubuntu, and Fedora are the operating systems that hopefully work.) Also, report any bugs introduced in this PR.

JeremyRand commented 10 years ago

@phelixbtc and @domob1812 , any objections to merging this?

JeremyRand commented 10 years ago

Suggested Tip4Commit awards:

Update Readme: 0.1% Add notes on building: 0.1% Fix typo in options.js: 0.5% Initial XULRunner support: 2% Merge branch: 0% Merge branch: 0% Increased max XULRunner version: 1%

domob1812 commented 10 years ago

While I can't really give you code review, I think it is fine for you to merge to Convergence according to your own judgement. At least, you get an ACK from me if phelix isn't opposed to it.

JeremyRand commented 10 years ago

@phelixbtc Are you able to build and/or test this?

phelixbtc commented 10 years ago

I'll give it a try, might take a couple of days, though.

JeremyRand commented 10 years ago

Thanks.

JeremyRand commented 10 years ago

@phelixbtc , installation instructions are now in the readme. Can you see if you can run it on Windows?

JeremyRand commented 10 years ago

@phelixbtc Have you had any luck testing?

JeremyRand commented 10 years ago

When testing, you'll need to use XULRunner 30 (31 isn't tested yet, so it's disabled in the package metadata).

crocket commented 10 years ago

I'm on ubuntu 14.04 64bit. When I executed the standalone on xulrunner 30.0, I saw

convergence

When I clicked option, I saw an error message as below.

************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "Cannot call openModalWindow on a hidden window"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: resource://gre/components/nsPrompter.js :: openModalWindow :: line 382"  data: no]
************************************************************

Although it works as an HTTP proxy, I really need it to work as a SOCKS proxy that passes requests to its parent proxy(e.g., Tor).

JeremyRand commented 10 years ago

@crocket Thanks for testing. I will check on this. I've never seen that error; maybe I'll be able to hunt it down. Cheers.

JeremyRand commented 10 years ago

@crocket , I get that behavior when I run xulrunner from the "client-standalone-files" directory; it should be run from the "client-standalone-build" directory, which is created by running "make" from the "client" directory. Can you check which directory you ran it from?

Thanks.

JeremyRand commented 10 years ago

@crocket , I just pushed some changes. Now XULRunner 31 should work, and I improved the TLS install scripts... the Ubuntu one might work for you. Any chance you could test this?

crocket commented 10 years ago

I'll test on this weekend.. On Aug 13, 2014 4:19 PM, "JeremyRand" notifications@github.com wrote:

@crocket https://github.com/crocket , I just pushed some changes. Now XULRunner 31 should work, and I improved the TLS install scripts... the Ubuntu one might work for you. Any chance you could test this?

— Reply to this email directly or view it on GitHub https://github.com/namecoin/Convergence/pull/5#issuecomment-52017280.

JeremyRand commented 10 years ago

Thanks.

JeremyRand commented 10 years ago

@phelixbtc , the XULRunner version now appears to work with TLS on Internet Explorer on Windows. I've pushed a script that sets up the certificate... if you're able to test when you have a few minutes, that would be awesome.

crocket commented 10 years ago

I tested this pull request against xulrunner 31 on Ubuntu 14.04.1 LTS 64bit. I built FreeSpeechMe and ran it as a standalone application.

After setting HTTP proxy to localhost:18833 and enabling remote DNS in Firefox 31, I couldn't browse .bit websites because Firefox routes DNS queries only via SOCKS proxy with remote DNS enabled.

To route DNS queries via FreeSpeechMe standalone, it needs to act as a SOCKS proxy.

JeremyRand commented 10 years ago

@crocket , I'm not sure exactly what you mean. To my knowledge, Firefox always passes DNS to HTTP/HTTPS proxies; the remote DNS setting is only necessary for SOCKS proxies. Can you explain?

(And yes, SOCKS server support is certainly planned. Probably won't be too hard either. But I'd like to get this code merged first.)

Cheers.

crocket commented 10 years ago

@JeremyRand I unchecked "remote DNS", but I can't visit .bit websites on chrome and firefox with localhost:18833 as HTTP proxy.

JeremyRand commented 10 years ago

@crocket What errors do you get (in Firefox, Chrome, and the command line window running FreeSpeechMe-Standalone), if any? Do .com websites load okay while going through the FreeSpeechMe-Standalone proxy?

crocket commented 10 years ago

While browsers are going through the standalone proxy, they can visit .com websites. When I visit .com websites, the standalone logs access. When I visit .bit websites, the standalone prints nothing, but browsers say there is no such domain.

JeremyRand commented 10 years ago

@crocket Can you go to the settings dialog in FreeSpeechMe-Standalone, click OK without changing anything, and then try again? I think occasionally stuff breaks if you haven't done that... still need to properly investigate that.

Also, just to verify, you have NMControl running on the default port? If you type "./nmcontrol.py dns getIp4 www.freespeechme.bit" from the directory where NMControl is, what does NMControl say? That might tell us if this is a FreeSpeechMe issue or an NMControl issue.

crocket commented 10 years ago

When I execute namecoind name_show dot-bit.bit, the console says error: {"code":-4,"message":"failed to read from name DB"}

However, namecoind getblockcount prints the latest blockchain.

I need to dig deeper into namecoind.

JeremyRand commented 10 years ago

@crocket I think that's normal for namecoind; namecoind would expect "namecoind name_show d/dot-bit", since the .bit parsing is handled by NMControl, not namecoind.

crocket commented 10 years ago

nmcontrol dns getIp4 dot-bit.bit and nmcontrol dns getIp4 freespeechme.bit print [] Howeer, nmcontrol dns getOnion federalistpapers.bit prints ["duskgytldkxiuqc6.onion"]

JeremyRand commented 10 years ago

@crocket Well, that's why FreeSpeechMe-Standalone isn't able to resolve the domains... I guess the problem is in NMControl. I'm not sure what exactly would cause NMControl to work properly for getOnion but not getIp4... are you running NMControl with default settings?

crocket commented 10 years ago

Somehow, nmcontrol started resolving dot-bit.bit, but it still can't resolve freespeechme.bit.

HTTP+HTTPS proxies work for chrome and firefox. Unfortunately, since firefox doesn't support HTTPS proxy, I couldn't visit https://dot-bit.bit on firefox.

In other words, it works on my machine. Congratulations.

JeremyRand commented 10 years ago

@crocket Excellent. So to verify, are you saying that dot-bit.bit works with both HTTP and HTTPS on Chrome, but only with HTTP on Firefox (HTTPS doesn't work for dot-bit.bit on Firefox)? If that's correct, what error does Firefox show, if any?

Thanks.

crocket commented 10 years ago

@JeremyRand Oh, I thought http://dot-bit.bit didn't exist. I could visit http://dot-bit.bit on firefox. But, firefox has no concept of HTTPS proxy, so I can't visit https://dot-bit.bit on firefox.

JeremyRand commented 10 years ago

@crocket I think Firefox calls it an "SSL proxy" rather than "HTTPS proxy". To make sure I understand your previous comment, does dot-bit.bit load with both HTTP and HTTPS on Chrome?

crocket commented 10 years ago

On both chrome and firefox, I can visit http://dot-bit.bit, but I can't visit https://dot-bit.bit because they fail to validate SSL certificate.

Firefox says "Error code: sec_error_bad_signature", and chrome keeps saying "The site's security certificate is not trusted!".

Other than SSL validation errors, .bit domain resolution works.

JeremyRand commented 10 years ago

@crocket Have you run the TLS installation script from a terminal? If you're on Ubuntu, it's "install_tls_ubuntu.sh". Make sure you run it while Firefox, Chrome, and FreeSpeechMe-Standalone are closed.

JeremyRand commented 9 years ago

@crocket Can you confirm whether TLS validation works on Ubuntu after running the TLS installation script, as per my previous message?

crocket commented 9 years ago

Right now, I'm busy, so I allocated a time slot on November 1st for the test.

crocket commented 9 years ago

@JeremyRand I'm sorry for not being able to help you for a while. I thought I could get some time, but I'm too busy extinguishing troubles arising from my day job. I won't have time for the next 3 months. I think you better test it yourself.

JeremyRand commented 9 years ago

@crocket No worries, thanks for trying.

JeremyRand commented 9 years ago

Since everyone agrees that this PR doesn't adversely affect the Firefox extension, and the standalone version seems to work for some people, I will be merging this if no NACKs are received within 72 hours. Any issues with the standalone version can be fixed by subsequent PR's.

JeremyRand commented 9 years ago

Merging.