Skip to content
Versora

Manual

Network and updates

Proxy

9 min read

On this page

In many companies, access to servers outside the internal network goes through a proxy. Versora needs to know which one it is in two places:

  • in git commands that talk to a server over HTTPS (clone, fetch, pull, push…);
  • in calls to the GitLab and GitHub API, which feed merge requests, pipelines, issues and notifications.

The Preferences › Network page decides both at once. It also shows what's in effect right now and where it came from, keeps the proxy username and password in the Windows vault and tests the connection to a server.

Tip

Versora doesn't write anything to the git configuration or to Windows to use the proxy. It only adjusts the environment variables of the git process it opens itself. The git you run in the terminal stays as it was.

Choose the proxy mode

The Proxy group has three modes. Switching between Automatic and None takes effect right away. Manual mode only takes effect after you enter the address and click Use this proxy.

Where to find it

  • Menu: Preferences › Network › Proxy
  • Palette (Ctrl+P): "Preferences: Network"
  • In a proxy or certificate error: the notice's Open Preferences › Network button

Step by step

  1. Open Preferences › Network.
  2. Choose one of the modes:
    • Automatic (system): Versora uses the proxy the computer already has.
    • Manual: you enter the proxy.
    • None: direct connection.
  3. In Manual mode, fill in Proxy (host:port), for example proxy.empresa.com:8080, and, if you want, the Exceptions (no proxy).
  4. Click Use this proxy.
  5. Check the In effect now box. It says what git commands and GitLab/GitHub will use.
OptionWhat it doesDefault
Automatic (system)"The proxy set in Git or in environment variables; otherwise the Windows one." The line also shows the current Windows proxy (for example "Windows: no proxy.").Yes
Manual"A proxy entered here, with exceptions."—
None"Direct connection, even if Windows or environment variables set a proxy."—
Proxy (host:port)Address of the manual proxy. Accepts host:port or http://host:port.empty
Exceptions (no proxy)Addresses that go direct, without the proxy, separated by semicolons. Accepts *.domain, domain, 10.*, 10.0.0.0/8 and <local>.empty

Where Automatic mode gets the proxy from

Automatic (system) mode looks in this order and uses the first one it finds:

  1. The http.proxy in the git configuration (global or system). When it exists, git uses it and Versora adds nothing, not even the exceptions. The page warns: "Git's http.proxy applies to Git commands and takes precedence over this preference; to change it, edit Git's configuration."
  2. The environment variables HTTPS_PROXY, HTTP_PROXY and ALL_PROXY, with their NO_PROXY.
  3. The proxy configured in Windows, with the Windows exceptions.

If Windows only has an automatic configuration script (PAC), Versora doesn't evaluate it. The page shows "Windows uses an automatic configuration script (PAC): …" and suggests: "If this network requires a proxy, choose Manual and enter the address (ask IT, or check the browser's proxy settings)." Until then, the connection is direct.

The exceptions

The exceptions accept both the Windows syntax and the NO_PROXY syntax:

ExampleGoes direct to
*.empresa.comany subdomain of empresa.com
empresa.comempresa.com and its subdomains
10.*any 10.x.x.x address
10.0.0.0/8the same range, in CIDR notation
<local>intranet names, without a dot (the Windows syntax)
*everything: no address goes through the proxy

localhost, 127.0.0.1 and ::1 never go through the proxy.

Git understands fewer formats than Windows. An exception with no git equivalent, such as <local> or a wildcard in the middle of the name, only applies to calls to GitLab/GitHub. In that case the page warns: "These exceptions have no Git equivalent and only apply to GitLab/GitHub: … For Git, add the server names (Manual)."

What Versora does in git

Nothing goes into ~/.gitconfig. In each git command it opens, Versora only adjusts the process environment:

# Manual, or Automatic through the Windows proxy
HTTPS_PROXY=http://proxy.empresa.com:8080
HTTP_PROXY=http://proxy.empresa.com:8080
NO_PROXY=localhost,127.0.0.1,::1,.empresa.com,10.0.0.0/8
# an inherited ALL_PROXY is removed

# None
# HTTPS_PROXY, HTTP_PROXY and ALL_PROXY are removed from the environment

The In effect now box shows the result in two lines:

  • Git commands: the proxy in use and where it came from: "the proxy set in Git itself", "the proxy from environment variables", "the Windows proxy — HTTPS: …; HTTP: …", the manual address or "direct connection". When Versora hands exceptions to git, the NO_PROXY=… line also appears.
  • GitLab/GitHub: the same for API calls, with the exceptions that apply to them.

Below come the facts read from the computer: Windows proxy, Windows exceptions, Environment variables and Git configuration. When the Windows proxy is set for the whole machine, "set by machine policy" appears. If git has a proxy only for some servers (http.<url>.proxy), the page lists those entries: "Git has a proxy set for specific servers (it applies to them in Git commands):".

Versora rereads Windows, the variables and git from time to time. Did you just change the Windows proxy? Click Read again.

How to undo

Choose another mode. The change applies to the next command. Since nothing was written to git or to Windows, there's nothing to clean up.

Caveats and messages

  • "SSH remotes don't go through an HTTP proxy.": a git@servidor:grupo/projeto.git remote doesn't use this configuration.
  • "Invalid proxy address: "…". Use host:port (e.g. proxy.example.com:8080).": the manual address isn't a valid HTTP/HTTPS proxy. Meanwhile, the In effect now box says "nothing applied: the manual address is invalid".
  • Automatic mode with only a PAC script in Windows results in a direct connection. If the network requires a proxy, use Manual.
  • Versora's automatic update uses this same path, including the username and password from the vault. See Automatic update.
  • The company policy can lock the proxy (proxy and proxy_bypass). See "Proxy locked by the policy", right below.
  • The policy can also make the whole page read-only (preferences_locked with network): it shows "This page is set by your company and is read-only." and nothing on it can be changed, not even the proxy username and password. See Policy keys.
  • If the company limits the servers, the page shows "Your company only allows these servers: …".

Proxy locked by the policy

When the company policy defines the proxy, the page's choice wouldn't apply: Versora uses the company's. That's why the locked fields are disabled, with the padlock icon and the policy notice, as in the other locked preferences. What you had chosen before applies again when the policy goes away.

The policy definesWhat gets lockedThe notice
proxy (with or without proxy_bypass)The three modes, Proxy (host:port), Exceptions (no proxy) and the Use this proxy button. The fields show the company's values."Set by your company: ‹proxy›. These fields stay locked while the policy is active; what you had chosen applies again when it goes away. The proxy username and password are still yours." At the top of the page, also: "The proxy is set by your company: ‹proxy›."
Only proxy_bypassOnly Exceptions (no proxy), with the company's list. The mode, the address and Use this proxy are still yours."The proxy exceptions are set by your company: ‹list›. The mode and the address are still your choice."

In the notice, ‹proxy› is the address of the company's manual proxy, "automatic (the Windows one)" or "none (direct connection)".

The Proxy authentication block isn't locked: the Username, the Password, Save and Remove password remain available, because the credential is yours. The exception is the whole page being read-only (preferences_locked with network).

For the administrator: the keys are in Policy keys.

Proxy username and password

Some proxies ask for a username and password. Versora keeps the password in the Windows credential vault and hands it to git through its own credential helper, without going through an environment variable, a file or the screen.

Where to find it

  • Menu: Preferences › Network › Proxy, Proxy authentication for ‹host› block. It appears when Versora hands the proxy to git (Manual mode, or Automatic through the Windows proxy).

Step by step

  1. Open Preferences › Network.
  2. In the Proxy authentication for proxy.empresa.com:8080 block, fill in Username and Password.
  3. Click Save. The notice confirms: "Proxy credential for … saved."
  4. The status line now says "Password stored in the Windows credential vault."

To change only the username, leave the password blank: the field shows "blank = keep the current one".

OptionWhat it doesDefault
UsernameThe proxy username. It goes in the proxy URL handed to git, without the password.empty
PasswordStored in the Windows vault.empty
Remove passwordDeletes the password from the vault.—

What Versora does in git

The proxy URL handed to git only carries the username (http://[email protected]:8080). When git needs the password, it asks Versora's credential helper, which reads it from the vault. Versora also keeps git from passing that password on to other installed helpers (Git Credential Manager, for example), so that Remove password really deletes it.

With no password in the vault, the username doesn't go in the URL. The proxy answers 407 and the error notice points to this page.

How to undo

Click Remove password. The line changes to "No password stored."

Caveats and messages

  • "Enter the proxy username.": fill in the username before saving a password.
  • "Credential vault unavailable: …" and "Couldn't save to the credential vault: …": Windows Credential Manager refused the operation.
  • "The proxy asked for a username and password (HTTP 407). Enter them in Preferences › Network — the password is kept in the Windows credential vault.": appears in a fetch, pull or push when the password is missing.

Even with the proxy locked by the policy (proxy or proxy_bypass), the username and password are still yours and can be changed. Only the whole page being read-only (preferences_locked with network) also locks this block.

Connection test

The Connection test group opens an address the same way calls to GitLab/GitHub do: the same proxy and the Windows certificates. It doesn't send the token. It's useful to find out, before a clone or before registering a server, whether the path to it is open.

Where to find it

  • Menu: Preferences › Network › Connection test

Step by step

  1. In Address to test, type the server, for example gitlab.empresa.com.
  2. Click Test. The button shows "Testing…".
  3. Read the result:

Caveats and messages

  • "Invalid address for the test: "…". Use the server's HTTPS address (e.g. gitlab.example.com).": the test only uses HTTPS.
  • A test that passes doesn't guarantee the token: it isn't sent. The token's validity is in Server tokens.

Proxy errors explained

When a git command fails because of the proxy, the error notice includes the explanation and the Open Preferences › Network button. It also shows "Proxy in use: …".

MessageWhat it meansWhat to do
"The proxy asked for a username and password (HTTP 407)…"The proxy requires authentication.Enter the username and password on the page.
"The proxy refused the connection to the server (HTTP …)…"The server is blocked at the proxy or should be reached directly.Check the exceptions, or talk to IT.
"The proxy's name couldn't be found…"The proxy address doesn't resolve.Check the address and the VPN.
"Couldn't connect to the proxy…"The proxy doesn't respond.Check the address, or choose "None" if this network doesn't use a proxy.
"The proxy closed the connection before opening the path to the server…"Usually, authentication git couldn't complete, or a block at the proxy.Enter the username and password; if it persists, talk to IT.
"The secure connection (TLS) failed before the certificate was checked…"A proxy or firewall intercepting the connection.Check the proxy on the page.

Certificate errors are in Certificates (TLS).

See also