Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Protocol "https:" not supported #181

Closed
nilsbecker opened this issue Nov 12, 2020 · 14 comments
Closed

Protocol "https:" not supported #181

nilsbecker opened this issue Nov 12, 2020 · 14 comments
Assignees

Comments

@nilsbecker
Copy link

hi, i just installed bw but i'm unable to either check bw update or to bw login. i'm behind a http proxy which is set via environment variables and works for other CLI programs just fine.

with bw login, i get the error message in the title. googling it gave me this issue in npm: npm/cli#2003 . it appears that this is an upstream bug in https-proxy-agent. they solved it by requiring a newer upstream version of node-agent-base. i think bw may be suffering from the same bug?

@kitos9112
Copy link
Contributor

Hi,

I'm hitting the exact same issue here too.

@kitos9112
Copy link
Contributor

kitos9112 commented Nov 12, 2020

Yes, @nilsbecker you're right it's an issue with that upstream library you mentioned earlier. I just built the CLI tool from source manually after changing the package.json file in the root directory to reflect the latest version of https-proxy-agent at 5.0.0

Hence, a simple node ./build/bw.js login worked magically as it should do by then asking for my 2FA code behind my corporate proxy.

Haven't done any regression testing though :)

@cscharf
Copy link
Contributor

cscharf commented Nov 13, 2020

Hi @kitos9112 , sorry I had accepted/merged and overlooked those a little too quickly. Apparently the latest updated version of https-proxy-agent does break our build with a TypeScript compiler error, which we'll need to figure out before we can accept this change across the board. I've reverted these changes and am re-opening this issue here for further evaluation.

@cscharf cscharf reopened this Nov 13, 2020
@kitos9112
Copy link
Contributor

Hi @cscharf - That's perfectly fine, hope you can pinpoint the issue and correct it.

Thanks!

@kitos9112
Copy link
Contributor

Hi @cscharf

What's the state of your build server? should be re-open the already-closed MR and take a closer look at the codebase?

Many thanks!

@cscharf
Copy link
Contributor

cscharf commented Nov 19, 2020

Hi @kitos9112 , we've not had an opportunity yet to dive into this, but it's on our radar.

@kitos9112
Copy link
Contributor

Hello @cscharf - is there an update regarding this issue? It's kinda blocking for us to use the CLI tool internally inside our enterprise infrastructure where all outbound traffic needs to traverse an HTTP proxy.

Cheers

@xfoxfu
Copy link

xfoxfu commented Jan 23, 2021

To whom blocking on this issue, I have found a workaround for those who do not actually requires a proxy to connect to Bitwarden. Just unset all environment variables related to proxy, such as HTTP_PROXY to disable proxy. Here is a snippet:

unset HTTP_PROXY
unset HTTPS_PROXY
unset http_proxy
unset https_proxy
unset ALL_PROXY
unset all_proxy

@kitos9112
Copy link
Contributor

Hi @xfoxfu your approach may work in an environment where you're either self-hosting your own BW appliance which is accessible via local routes (not reaching out to the Internet) or where despite having a proxy in place, your HTTP requests can still go through. None of those scenarios is my use case. I leverage the cloud offering of BW and all my outbound traffic is torn down before it leaves my default gateway.

I did notice @cscharf is working on fixing the build server on another repo which may be closely related --> bitwarden/jslib#246

@eliykat
Copy link
Member

eliykat commented Jan 26, 2021

Hi @kitos9112, this has been assigned to me and I'm looking into it. You're right that the action is happening over at -> bitwarden/jslib#246.

@eliykat
Copy link
Member

eliykat commented Jan 28, 2021

The upgrade to https-proxy-agent has now been merged, which according to @kitos9112 should solve the original issue here. I'll close this issue, but if the problem pops back up, please let us know.

@eliykat eliykat closed this as completed Jan 28, 2021
@kitos9112
Copy link
Contributor

@eliykat Thank you, however I cannot see a new PR opened to bump the external NPM dependency in this module.
@cscharf are we in good shape to re-open or cherry pick #183 now?

@cscharf
Copy link
Contributor

cscharf commented Jan 29, 2021

@eliykat , oh yeah, Thomas, can you please update in CLI and Directory Connector as well to mirror jslib? thanks!

@eliykat
Copy link
Member

eliykat commented Feb 2, 2021

@kitos9112 Sorry about that - have now bumped it across all relevant repos:

  • jslib (✅ )
  • cli (✅ )
  • directory-connector (✅) - but note this is waiting on an unrelated PR before it'll build properly, see the PR discussion if you're wanting to pull this in the meantime

Please ping me here if I've missed anything else or if it gives you any errors.

@eliykat eliykat closed this as completed Feb 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants