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

clasp login return offline #336

Closed
puentesdiaz opened this issue Sep 26, 2018 · 6 comments
Closed

clasp login return offline #336

puentesdiaz opened this issue Sep 26, 2018 · 6 comments

Comments

@puentesdiaz
Copy link

After install clasp via npm over corporate proxy, i have no problem
i can run : clasp -v ..fine...
but ...

Steps to Reproduce the Problem

  1. clasp login

Error: Looks like you are offline.

Specifications

  • Node version (node -v): 10.10.0
  • Version (clasp -v): 1.5.3
  • OS :Windows
@grant
Copy link
Contributor

grant commented Oct 1, 2018

I'll have to make the internet check optional.
Can you try:
clasp login --no-localhost

@puentesdiaz
Copy link
Author

clasp login --no-localhost

I'll have to make the internet check optional.
Can you try:
clasp login --no-localhost

Yes i can, but throw same error

@grant
Copy link
Contributor

grant commented Oct 2, 2018

OK, I'll fix this issue.

Remove this line:
https://github.com/google/clasp/blob/master/src/auth.ts#L165

@aakasaka
Copy link

aakasaka commented Oct 3, 2018

I have the same problem with login under the proxy.
When I comment out the lines using is-online , the message "Looks like you are offline" disappeared and my browser open google auth page, but error showed in console and login failed.

Error retrieving access token: Error: write EPROTO 19024:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:openssl\ssl\record\ssl3_record.c:252:

Is that a same problem with #8 ?

@grant
Copy link
Contributor

grant commented Oct 9, 2018

I think this is fixed with the proxy support referenced above.
We skip checking is-offline when there's a proxy.

@grant grant closed this as completed Oct 9, 2018
@thedrs
Copy link

thedrs commented Jan 10, 2023

I solved this issue - here is the story:

I am on windows in a very restricted corporate enterprise which has to use an http and https proxy.
We do have normal google services accessible in the browser.
Obviously 'clasp login' does not work without a proxy, it gives:
Error retrieving access token: FetchError: request to https://oauth2.googleapis.com/token failed, reason: connect ETIMEDOUT 216.58.212.202:443
(It does work if i disconnect my computer from corporate and connect to public internet)

So i defined these two env variables in cmd (you can also do it in git bash console, just replace "set" with "export"):
set HTTP_PROXY=http://proxy.mycompany.com:80
set HTTPS_PROXY=https://proxy.mycompany.com:80
(our corporate proxy uses port 80 for both http and https !)

this is the error i got:
Error retrieving access token: FetchError: request to https://oauth2.googleapis.com/token failed, reason: write EPROTO EC110000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:355:

The solution to my problem was that our https proxy used an http address, so i fixed the set to the following :
set HTTPS_PROXY=http://proxy.mycompany.com:80
(note the http:// and not https:// on the right hand side)

Hope i helped others here too

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

No branches or pull requests

4 participants