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

Use an OS-chosen port number for tor socks proxy #649

Closed
riastradh-brave opened this issue Jul 26, 2018 · 1 comment · Fixed by brave/brave-core#4802
Closed

Use an OS-chosen port number for tor socks proxy #649

riastradh-brave opened this issue Jul 26, 2018 · 1 comment · Fixed by brave/brave-core#4802

Comments

@riastradh-brave
Copy link
Contributor

Currently, in browser-laptop, we use port 9250, 9260, 9270, 9280, or 9290 for the tor socks proxy, depending on the release channel. This allows a standard release of Brave to coexist with a beta release to coexist with a local development build, but not more than one of each kind at a time, and if anything happens to be using the port number when Brave starts, it just fails. We should let the tor daemon ask the OS to choose an unused port number and use that instead.

This requires an extra step from what we currently do in browser-laptop. Specifically, currently, we:

  1. Pick the port number, say 9250.
  2. Create a Tor browser context with a Tor socks proxy config pointing at socks5://127.0.0.1:9250.
    • (The Tor socks proxy config is customized to use a unique username and password per first-party origin, per per fresh load.)
  3. Start tor with --socksport 9250.

Instead, we should:

  1. Create a Tor browser context with an uninitialized Tor socks proxy config that blocks all requests.
  2. Start tor with --socksport 0.
  3. Learn the port number from the tor control channel: GETINFO net/listeners/socks.
  4. Configure the Tor socks proxy config with the port number we learn from that.
@riastradh-brave riastradh-brave self-assigned this Jul 26, 2018
@bbondy bbondy added this to the Releasable builds milestone Jul 30, 2018
@darkdh darkdh modified the milestones: Releasable builds 0.55.x, 1.x Backlog Sep 22, 2018
@rebron rebron added the priority/P3 The next thing for us to work on. It'll ride the trains. label Sep 28, 2018
@tildelowengrimm tildelowengrimm added priority/P4 Planned work. We expect to get to it "soon". and removed priority/P3 The next thing for us to work on. It'll ride the trains. labels Oct 30, 2018
@rebron rebron modified the milestone: 1.x Backlog Feb 7, 2019
@rebron rebron removed this from the 1.x Backlog milestone Feb 7, 2019
@riastradh-brave riastradh-brave added the needs-investigation A bug not 100% confirmed/fixed label Jul 25, 2019
@darkdh darkdh self-assigned this Aug 18, 2020
@darkdh darkdh added the QA/Yes label Aug 28, 2020
@darkdh darkdh added this to the 1.16.x - Nightly milestone Sep 17, 2020
@btlechowski
Copy link

btlechowski commented Oct 5, 2020

Verification passed on

Brave 1.16.50 Chromium: 86.0.4240.55 (Official Build) dev (x86_64)
Revision a6d625ef6f7fe8ea0675f1cf759155a05ee1be40-refs/branch-heads/4240@{#953}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#4802

Verified OS-chosen port for tor
Opened Tor Window the first time
image

Opened Tor Window the second time
image

Rest of the verification done in #359 (comment)


Verified passed with

Brave	1.16.55 Chromium: 86.0.4240.72 (Official Build) dev (x86_64)
Revision	581582174c512f44f44fd1aea340471f54b2365f-refs/branch-heads/4240@{#1134}
OS	macOS Version 10.14.6 (Build 18G3020)

Verified test plan from brave/brave-core#4802 - notes can be found under #359 (comment)


Verification passed on


Brave | 1.16.55 Chromium: 86.0.4240.72 (Official Build) dev (64-bit)
-- | --
Revision | 581582174c512f44f44fd1aea340471f54b2365f-refs/branch-heads/4240@{#1134}
OS | Windows 10 OS Version 1903 (Build 18362.1082)


Verified test plan from brave/brave-core#4802 - notes can be found under #359 (comment)

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

Successfully merging a pull request may close this issue.

8 participants