Skip to content

leetcode-cn.com account can not sign in with Error: certificate has expired #563

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

Closed
kbkbks opened this issue May 30, 2020 · 30 comments · Fixed by #565 or #566
Closed

leetcode-cn.com account can not sign in with Error: certificate has expired #563

kbkbks opened this issue May 30, 2020 · 30 comments · Fixed by #565 or #566

Comments

@kbkbks
Copy link

kbkbks commented May 30, 2020

🐛 Bug Report

leetcode-cn.com account can not sign in.

To Reproduce

  1. Sign in to LeetCode (EndPoint has been switched to China).
  2. Choose sign in method, Leetcode Account.
  3. Enter the username and password (Enter the E-mail will have the same problem).
  4. Can not sign in with Error: certificate has expired.

Expected behavior

Sign in leetcode-cn.com correctly.

Extension Output

2020-05-31 03-40-47屏幕截图

Your Environment

  • os: Ubuntu 18.04.4 LTS
  • extension settings: default
  • nodejs version: v8.10.0
  • vscode version: 1,45,1
  • extension version: 0.16.2
@alexzhangwhu
Copy link

+1

@yihong0618
Copy link
Contributor

yihong0618 commented May 31, 2020

@alexzhangwhu @kbkbks
Leetcode.cn changed its login api, maybe I can fix this.
Let me check it later today.

@pastqing
Copy link

+1

@simon5057
Copy link

how's it going,my friend.

@kbkbks
Copy link
Author

kbkbks commented Jun 1, 2020

@nslyc
how's it going,my friend.

Still can not sign in.

@jdneo
Copy link
Member

jdneo commented Jun 1, 2020

@ALL

Will it work if using the cookie login? See: #478 (comment)

@yihong0618
Copy link
Contributor

@jdneo I think its not match leetcode-cn, leetcode-cn use a different way store cookie.

@dageita
Copy link

dageita commented Jun 1, 2020

+1

@yihong0618
Copy link
Contributor

yihong0618 commented Jun 1, 2020

@ALL
For now it seems only GitHub way to login can be used, and LinkedIn way is on the way,see leetcode-tools/leetcode-cli#43 for leetcode-cn and I will work on this tonight, but I think leetcode-cn is using graphql which is a little complicated, I need some time also for the cookie way.

And if you want login you can try link GitHub and login, and make sure you have at least login once for your computer.

@bailongxian
Copy link

acount login way still not available

@JohnnyWei188
Copy link

yeah, i have the same problem with account login...

login: pass: - Signing in leetcode-cn.com
[ERROR] Error: certificate has expired

@jdneo
Copy link
Member

jdneo commented Jun 2, 2020

That's wired. I tested locally and can login to leetcode.cn.

@yihong0618 Can you login to leetcode.cn?

@yihong0618
Copy link
Contributor

yihong0618 commented Jun 2, 2020

That's wired. I tested locally and can login to leetcode.cn.

@yihong0618 Can you login to leetcode.cn?

Yes old terminal is fine using vscode-leetcode, I have tested, but when you use a new terminal all methods can not. You can try use leetcode-cli and use a new terminal for test, or you can sign up a new account .

@jdneo
Copy link
Member

jdneo commented Jun 2, 2020

Thanks @yihong0618

what do you mean by new terminal? I mean, what's the difference between new and old terminal?

@yihong0618
Copy link
Contributor

yihong0618 commented Jun 2, 2020

@jdneo
Like you do not use vscode-leetcode just leetcode-cli and use a new computer or something to try to login.
And I just sign up a new account, login fine in vscode, failed in just leetcode-cli in a windows sub-system ubuntu.

forget it .

@border
Copy link

border commented Jun 2, 2020

+1
have the same problem, leetcode-cn.com certificate has expired.

@yihong0618
Copy link
Contributor

yihong0618 commented Jun 2, 2020

@ALL @jdneo
I have kind of solved these problem. Please help me to check. It is not the api problem, but its node tls problem.
Please check your node version if it version <= 10 , when leetcode-api interact with node, it will cause the problem. See firebase/firebase-tools#1901


If you do not know how to update node you can try this https://stackoverflow.com/questions/10075990/upgrading-node-js-to-latest-version

This was referenced Jun 2, 2020
@dageita
Copy link

dageita commented Jun 2, 2020

thanks @yihong0618, which solved this error!

@yihong0618
Copy link
Contributor

@dageita Its too wired. - -

@dageita
Copy link

dageita commented Jun 2, 2020

@yihong0618 I have nodejs v8.17.0 on centos7.5, but it still needs to update.

@yihong0618
Copy link
Contributor

yihong0618 commented Jun 2, 2020

@yihong0618 I have nodejs v8.17.0 on centos7.5, but it still needs to update.

can you help me find which is minimal? I update to 14.3 ...

@dageita
Copy link

dageita commented Jun 2, 2020

@yihong0618 I have nodejs v8.17.0 on centos7.5, but it still needs to update.

can you help me find which is minal? I update to 14.3 ...

I also update to 14.3 😀

@yihong0618
Copy link
Contributor

@yihong0618 I have nodejs v8.17.0 on centos7.5, but it still needs to update.

can you help me find which is minal? I update to 14.3 ...

I also update to 14.3 😀

Minimal seems 10.

@Maxwell-Lyu
Copy link

Maxwell-Lyu commented Jun 3, 2020

@ALL @jdneo
I have kind of solved these problem. Please help me to check. It is not the api problem, but its node tls problem.
Please check your node version if it version <= 10 , when leetcode-api interact with node, it will cause the problem. See firebase/firebase-tools#1901

If you do not know how to update node you can try this https://stackoverflow.com/questions/10075990/upgrading-node-js-to-latest-version

  • system
    ubuntu: 18.04
    vscode: 1.44.0
    vscode-leetcode: 0.16.2
    nodejs: 8.10.0

upgrading nodejs to latest stable version solves the problem

  • what I have done
sudo npm install n -g
sudo n stable

@zhiyuzhao
Copy link

@yihong0618 I upgrade my node by nvm, but still occur 'certificate has expired' error.
I found my vscode output still printed v8.9.0. Which node the extension use? I check the node version in terminal, alread upgrade succsess.
image
image

@yihong0618
Copy link
Contributor

@yihong0618 I upgrade my node by nvm, but still occur 'certificate has expired' error.
I found my vscode output still printed v8.9.0. Which node the extension use? I check the node version in terminal, alread upgrade succsess.
image
image

see this
https://stackoverflow.com/questions/44700432/visual-studio-code-to-use-node-version-specified-by-nvm

@zhiyuzhao
Copy link

THX it's work!

@xoyolucas
Copy link

Thanks a lot!

@ranlix
Copy link

ranlix commented Jul 30, 2020

I notice that vscode-leetcode plugin requires a Node version newer than 10.0, so I manually fill in the leetcode-node path with a lts/erbium(Node v12.18.2), then I login successfully.


我注意到插件详情页有个需求是需要Node版本要10以上,所以就在vs设置页,找到leetcode的相关配置,手动填入了nodejs 12的版本路径,后来再次登录cn站就OK了

@yihong0618
Copy link
Contributor

@jdneo can we add version check in vscode-leetcode init?

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

Successfully merging a pull request may close this issue.