Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can no longer connect to TOR #395

Closed
lucknaumann opened this issue Apr 24, 2021 · 16 comments
Closed

Can no longer connect to TOR #395

lucknaumann opened this issue Apr 24, 2021 · 16 comments

Comments

@lucknaumann
Copy link

Hi, I hope you are well.
I just updated to EM v4.12.1 and can no longer connect to ProtonMail via TOR. Granted, I haven't updated the EM app since v4.10.2, as I haven't used it again until now. It worked before updating the app, and I can log in through the TOR browser. Is there something new I need to do?
I have two accounts I use with PM, the other one I log in with the regular website, and that works fine in EM. I'm on Windows 10, 20H2.

@vladimiry
Copy link
Owner

Nothing has changed regarding TOR use. See #113 (comment).

@lucknaumann
Copy link
Author

Thanks for your response. I have seen that comment, which is how I set it up before. Since I haven't changed anything, I don't know why it isn't working now. Is there a debugging log I could post for you?

@vladimiry
Copy link
Owner

vladimiry commented Apr 24, 2021

There were no TOR related changes in the app aside from the @electron / @chromium update. I've just tried TOR use on Linux and it works for me with the recent app release. It's unlikely but maybe @electron has broken proxy rules applying on Windows.

can no longer connect to ProtonMail via TOR

What does the problem look like? You submit the password login form and then get network connection error message?

Also:

  • Are you sure your TOR setup is functioning well? Maybe try to map a regular browser like chrome/firefox to socks5://localhost:9050 to test the TOR setup.
  • Does it work if you downgrade the app version?

@lucknaumann
Copy link
Author

lucknaumann commented Apr 24, 2021

Yeah. At first, I had the persistent log-in enabled and got a message saying it couldn't connect to the network and reload the page. When I clicked on reload, it just gave me the same error message. I thought maybe it was some sort of cache error, so I disabled the persistent log-in, and now it won't log in.

Edit: Should I try downgrading? If so, would I just do a normal uninstall, or do I need to backup some settings?

@vladimiry
Copy link
Owner

vladimiry commented Apr 24, 2021

I still tend to think it's the network/TOR setup issue at your side. But also might be at the @ProtonMail's side since I remember there were cases when @ProtonMail didn't allow to login via TOR saying that there are too many login attempts or something like that.

If you want to try downgrading, I'd first backup the settings folder just in case (whole folder or just files listed in https://github.com/vladimiry/ElectronMail/blob/master/README.md#dataconfig-files-created-and-used-by-the-app).

@vladimiry
Copy link
Owner

I still tend to think it's the network/TOR setup issue at your side.

To test the TOR setup you can map a regular browser like chrome/firefox to socks5://localhost:9050 and see if the https://protonirockerxow.onion/ page gets loaded.

@lucknaumann
Copy link
Author

I still tend to think it's the network/TOR setup issue at your side.

To test the TOR setup you can map a regular browser like chrome/firefox to socks5://localhost:9050 and see if the https://protonirockerxow.onion/ page gets loaded.

OK. I'll try that and report back.

Otherwise, I'm not sure what the network setup on my side would be different from what it was before, since nothing changed between updating EM versions. PM is allowing me to log in via the TOR browser through their onion site, so I don't think they're blocking my log-in attempts.

I will try the mapping now.

@lucknaumann
Copy link
Author

lucknaumann commented Apr 24, 2021

I don't know if I did the mapping correctly or not, but it didn't work. I used Firefox since it allows using a proxy only for that browser. I looked into it a bit but am still unsure if I needed to do something else to get the proxy working with Firefox. I also don't know what network settings could have changed since Feb. to block another app from using Tor.

Edit: I recall testing this some months ago in Firefox since I had read about testing it that way, and it not working. But since it was working in EM at the time, I didn't look further into it. While looking into it today, there was mention of hooking the connection up with the Tor browser running in the background. It sounded complicated, so I installed an add-on that does this and it worked. However, I had no such settings prior to EM not working, so whatever network settings that might need to be in place now that differ from then, I wouldn't know.

Further, the Tor docs state to only use the Torified Tor browser, as it's set up to use the Tor network. Since EM must also be set up to use the Tor network, and I have not changed any settings in EM nor my network, I am at a loss as to why it's no longer working. If it's indeed a Chromium issue, then hopefully it'll be fixed in the next update. If you have suggestions as to what settings in my own network I should check, let me know. Otherwise, I will attempt to downgrade later and see if that works.

@vladimiry
Copy link
Owner

vladimiry commented Apr 25, 2021

To be honest I don't know what is the best way to expose the Tor thing to socks5://localhost:9050 on Windows since I run Linux only.

If you look into #113 (comment) I didn't write that you need to start Tor Browser but tor.exe which by default exposes the Tor as socks5://localhost:9050 (at least at the time the comment was written the tor.exe acted this way).

I will attempt to downgrade later and see if that works.

Before trying downgrade (which I don't believe will help), I still recommend to first ensure that the Tor is well exposed as socks5://localhost:9050.

The simple way to do the test is to run chromium like chrome.exe --proxy-server="socks5://127.0.0.1:9050" --user-data-dir=c:/chromium-test (full path to chrome.exe might be required) and then open https://protonirockerxow.onion/ in it. Remove the c:/chromium-test folder after testing gets finished.

@lucknaumann
Copy link
Author

Thanks for your response. I figured you might not know some things about Windows and its network (and Tor), which is fine. I use it and don't know many things about it. 😆 Thanks for the info about running the chrome.exe command. That's interesting.

Yeah, I noticed that your post mentions tor.exe. However, running it in the console results in no output, and running it with start tor.exe just opens another console window with tor.exe as the title. Unless I did something wrong (likely). What I had read elsewhere said to have the actual browser running. That's because it launches a background process, probably the tor.exe, that helps other apps connect to the onion network. That might be old information, though, and may no longer work that way. It seems there's something more complex that needs to happen. Regardless, I solved the problem.

I remembered something about programs and Windows installs: sometimes the previous version needs to be removed before installing an upgrade, and sometimes an install doesn't go well. I think that's what happened. That something didn't go right with the upgrade process for whatever reason (it happens), and this affected the connection to Tor. I uninstalled EM but didn't downgrade. Instead, I reinstalled the current version, copied over the files you pointed me to in your previous comment and viola! It works fine now. If only I had done that, to begin with!

@lucknaumann
Copy link
Author

I don't recall if the EM installer removes the previous version of the program first, but if not, it would be a good idea for it to remove any files having to do with the program itself while leaving all the settings files. Many Windows installers do this, with a message informing the user about it. Usually, something along the lines of: "This will uninstall the previous version of the program but leave all your settings in place. Proceed? (Yes/Cancel buttons)." Or you could tell Windows users to manually backup the settings files and uninstall the prior version before installing the new one. Just a suggestion to avoid any future such issues.

Anyway, thanks again for your help and quick responses! 😄

@vladimiry
Copy link
Owner

vladimiry commented Apr 26, 2021

I'm glad you didn't give up fighting the issue. Regarding tweaking the windows installer, this is not planned fro the near future.

@lucknaumann
Copy link
Author

I'm glad you didn't give up fighting the issue. Regarding tweaking the windows installer, this is not planned fro the near future.

I understand. If you decide to do that later on and need an example, the installer for qBittorrent does that. Thanks.

@vladimiry
Copy link
Owner

vladimiry commented Apr 27, 2021

The thing is that aside from other reasons, at least on linux and probably on macos too removing user's data on app uninstalling is not practiced. I normally prefer the app demonstrates similar behavior on all the platforms. But tweaking the win/nsis installer is technically possible (there is already one necessarily tweak enabled).

I think the versatile option would be in using a sort of custom loader tool/binary. The tool would:

  • Wipe all the unnecessarily stuff (generated by @electron) from the settings folder.
  • Start the app with --js-flags="--max-old-space-size=6144" like argument (the arg currently added to the shortcuts as a workaround, macos missing this hack btw) before the actual @electron app starts.
  • Do other things possibly needed in the future to be performed before the actual @electron app starts.

@lucknaumann
Copy link
Author

lucknaumann commented Apr 27, 2021

I applaud and appreciate your versatile option, even though I'm not a dev and don't understand the --js-flags="--max-old-space-size=6144" part, but I likely don't need to. 😄

I understand not wanting to tweak the Windows installer, and I'm glad you support multiple platforms. That's why I also suggested letting Windows users know that they should back up the settings files, then uninstall before installing the newer version. Or add it to the FAQ or README as a Windows troubleshooting step or something similar.

My main objective is to let other Windows users know that as a step to prevent potential issues, or if they are having an issue, this should be a first step in solving it. Some Windows users do this because... Windows OS, but as I had forgotten about doing this, it could save both you and them time. And speaking of Windows OS, it is sadly not as well programed as Linux and probably Mac, since they both have Unix as a base. And we all know that Unix is far superior. (Well, Linux is a derivative, but why split hairs?) 😀

@vladimiry
Copy link
Owner

vladimiry commented Apr 28, 2021

add it to the FAQ

The point has been listed in the https://github.com/vladimiry/ElectronMail/wiki/FAQ.

don't understand the --js-flags="--max-old-space-size=6144" part, but I likely don't need to.

It just lets the main process of the app use more than 2GB of RAM. It's useful if the "local store" option is enabled and you got a lot of mails in the account, like 20k+. The argument prevents the app from crashing with the out of memory like error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants