CLI Proxy support

jaz_111
jaz_111
Community Member

Hi,

CLI tool is ignoring underlying proxy settings in Linux environment. That is causing tool not to work behind corporate proxy environment.

Implementing FW rule is not an option by company policies.

Any plans to support proxies for CLI tool?

Proxy settings:

[~] $ env|grep proxy
http_proxy=<redacted>
https_proxy=<redacted>

Internet access via proxy works fine:

[~] $ curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

CLI tool will not reach the servers:

[~] $ op signin my.1password.com <redacted> --raw
[ERROR] 2021/01/19 10:41:17 Couldn't connect to the sign-in address you provided. Check the address and your network connection, then try again.

1Password Version: 1.8.0
Extension Version: Not Provided
OS Version: Linux
Sync Type: Not Provided
Referrer: forum-search:CLI proxy

Comments

  • ag_yaron
    ag_yaron
    1Password Alumni

    Hey @jaz_111 ,

    The CLI tool should definitely work properly while using a proxy, there are no special settings for it. Support for proxies comes straight out of the box in Go (the programming language used to build the CLI).

    Just to make sure, we set up a local proxy server (Fiddler), set our http_proxy environment variables to redirect network request through Fiddler, and were able to see that op works just fine.

    So the most likely culprit is the format/structure of your http_proxy and https_proxy environment variables. Are you able to share the value of your https_proxy and http_proxy environment variables, either here on the forum or via email if you prefer not to share it in public?

  • aberends
    aberends
    Community Member

    Tested with:

    $ env | grep -i proxy
    .. no output, so no environment variables for proxy set ..

    $ https_proxy=http://some.proxy.server:3128 curl -s https://www.nu.nl
    .. shows page ..

    $ HTTPS_PROXY=http://some.proxy.server:3128 curl -s https://www.nu.nl
    .. shows page ..

    $ https_proxy=http://some.proxy.server:3128 op signin https://company.1password.eu user@company.nl
    .. no reaction ..

    $ HTTPS_PROXY=http://some.proxy.server:3128 op signin https://company.1password.eu user@company.nl
    .. no reaction ..

    $ https_proxy=http://some.proxy.server:3128 op signin company.1password.eu user@company.nl
    .. no reaction ..

    $ HTTPS_PROXY=http://some.proxy.server:3128 op signin company.1password.eu user@company.nl
    .. no reaction ..

    Also tested from home without proxy and get positive results:

    $ op signin https://company.1password.eu user@company.nl
    .. secret, password, OTP ..
    .. success, got session token ..

    $ op signin company.1password.eu user@company.nl
    .. secret, password, OTP ..
    .. success, got session token ..

    The version of the op tool:

    $ op --version
    1.11.2

    So, for now my conclusion is that the op tool does not honour the http_proxy, https_proxy, HTTP_PROXY or HTTPS_PROXY environment variables, whereas curl does.

    Does any other way exist to configure a proxy for the op tool?

  • Hey @aberends, I'm sorry this isn't working for you. You've found a regression in proxy support for sign-in, introduced in v1.11.2. Thank you for bringing this to our attention! We're looking into a fix and will keep you updated. Meanwhile, you should be able to use the CLI with a proxy configured using v1.11.1.

  • Sash
    Sash
    Community Member

    @simon_1P Are there any limitations on the Mac , too ? We are trying to use the CLI behind a proxy on macOS and system settings have a automatic proxy config via wpad file but the CLI cannot connect to 1Password servers ?

  • Hi @Sash and @aberends , we addressed the reported problem in v1.11.3.

    @Sash could you try configuring the proxy using HTTP_PROXY and HTTPS_PROXY?

This discussion has been closed.