Why do I get "malformed URL" error when performing remote actions using GitKraken in a corporate environment?

Why is GitKraken using a proxy when I haven't configured one?

GitKraken is automatically pulling proxy configuration from your system's proxy settings (Internet Options > Connections > LAN Settings). In your case it looks like you have configured a PAC file in the "Automatic configuration" section. GitKraken (or one of the libraries it uses) is reading this file and determining how to contact external systems.

Why is GitKraken using an external proxy for internal addresses?

GitKraken (or one of the libraries it uses) appears to be incorrectly assuming proxy settings. When GitKraken starts it connects to its update servers. Before it connects it determines how to connect to it via the PAC file. In this case, you likely use a proxy for external internet access to this connection occurs via your proxy. When you attempt to perform an action on a remote this lookup does not happen again. It incorrectly re-uses the proxy configuration from the update check for internal repositories.

How can I resolve this and be able to interact with my remotes?

You have a few options:

  1. Temporarily disable your proxy configuration when you open GitKraken. You can turn off all proxies via Internet Options > Connections > LAN Settings. Open GitKraken, wait for it to fully start. Turn your proxy settings back on. You should be able to perform actions as normal.
  2. Modify your Proxy Auto Configuration (PAC) file to return DIRECT (no proxy) for the GitKraken update servers. This will "trick" GitKraken into thinking a proxy is not necessary and will not attempt to use it for local traffic. I suggest configuring your PAC file to return DIRECT for the following wildcard: *://*.gitkraken.com/*

For example in the FindProxyForURL function: if (shExpMatch(url, "*://*.gitkraken.com/*")) { return "DIRECT"; }

Note: If your organization has firewalls that prevent direct internet access you may need to take additional care here as this could affect your ability to access public repos such as those at GitHub. You may need to leave proxies on for external repositories and do the #1 option for internal repositories.

To answer your question "why is GitKraken using a proxy when I haven't configured one?" GitKraken on mac uses the global network configurations(Network preferences > Select the network interface > Click Advanced... > and select proxy tab. If you have configured "Automatic Proxy Configuration" or "HTTP" or "HTTPS" proxy settings then that's what gets used.

If you have selected "Auto proxy Discovery" or "Automatic Proxy Configuration" then the "Bypass proxy settings for these hosts & Domains" usually does not work.

How can I make this work? I tried multiple solutions but the one that has worked for me was the following -

I am on GitKraken version 6.5.3. I am working behind proxies as well. GitKraken uses the global ~./gitconfig file and if you have configured the proxies there then it would use that in the absence of other configuration. I had specific settings -

    sslVerify = true
    proxy = "http://myproxy.com"
    sslVerify = false
    proxy = "https://myproxy.com"
[http "https://internalurls.com/"]
   sslVerify = false
    proxy = ""

This configuration works for the git command line, and the internal urls are resolved properly, but GitKraken only is using the http and https configurations and not the specific urls configuration. So every time I configure/try to connect to the internal urls I comment out the lines for the general http and https proxies and that has worked for me.

I hope GitKraken in the future gives the users the option to select the proxies or read the entire gitconfig section to search for all the proxies.

I hope this answer helps you.