vscode-leetcode icon indicating copy to clipboard operation
vscode-leetcode copied to clipboard

Error: self signed certificate in certificate chain

Open rickdgit opened this issue 5 years ago • 10 comments

🐛 Bug Report

A clear and concise description of what the bug is. Not able to login to leetcode. due to certificate error

To Reproduce

Steps to reproduce the behavior.

Expected behavior

A clear and concise description of what you expected to happen.

Extension Output

Paste here the LeetCode extension log from output channel.

[ERROR] You are not login yet? login: pass: - Signing in leetcode.com [ERROR] Error: self signed certificate in certificate chain

Guidance: Press Ctrl+Shift+U, and toggle the channel to LeetCode.

Your Environment

  • os: Windows 10
  • extension settings :
  • nodejs version: 12.8.1
  • vscode version: 1.38.1
  • extension version: 0.15.5

The output shows the error msg

[ERROR] You are not login yet? login: pass: - Signing in leetcode.com [ERROR] Error: self signed certificate in certificate chain

Im behind a firewall with self signed certs. I assume this may require https requests config change.

PS: I don't think this is duplicated as #370 . They are all certs related but root cause may different

rickdgit avatar Oct 04 '19 17:10 rickdgit

User setting.json has been updated with "http.proxyStrictSSL": false,

Still not working

rickdgit avatar Oct 04 '19 17:10 rickdgit

@jdneo I met the same issue. For same reason in my work, I need to set git config --global http.sslVerify false. I am not sure if it is caused by this setting. Is there any solution now?

Here is a similar issue: Error: self signed certificate in certificate chain · Issue #695 · nodejs/node-gyp

yanglr avatar Oct 07 '19 06:10 yanglr

Further investigation indicates the error msg came from Leetcode-cli Got same error msg when trying login via leetcode cli

rickdgit avatar Oct 07 '19 15:10 rickdgit

Create ticket https://github.com/skygragon/leetcode-cli/issues/186

rickdgit avatar Oct 07 '19 15:10 rickdgit

Hey @rickdgit,

Thank you for your effort on this issue. So far I think the author of LeetCode CLI has no time to maintain this project (See:https://github.com/skygragon/leetcode-cli/issues/181).

It would be great if you can dig deeper into this and send out a fix. 😄

jdneo avatar Oct 08 '19 01:10 jdneo

Hi @jdneo

I can take a look later and so sad the skygragon suffered from 996... Are you taking the ownership for leetcode-cli ?

rickdgit avatar Oct 08 '19 19:10 rickdgit

I'm not the owener of the leetcode cli. So far I just fork it to unblock the vscode extension. But that is not a way which I preferred to do so.

Before skygragon came back or find a new guy to take care of the cli. You can first send pull request to https://github.com/leetcode-tools/leetcode-cli. And thank you for your enthusiasm to this project.

jdneo avatar Oct 09 '19 01:10 jdneo

I have some question of this. I do not know why occur the question, If you have solve it, please tell me. Thanks.

tingfenghanlei avatar Oct 10 '19 07:10 tingfenghanlei

For Windows users, you may try to add process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0 at the beginning of the following files C:\Users\YourUserName\.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.cn.js and C:\Users\YourUserName\.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js

For other users, there may be similar files where you can add.

WeikaiZhou avatar Oct 25 '23 06:10 WeikaiZhou

For Windows users, you may try to add process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0 at the beginning of the following files C:\Users\YourUserName\.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.cn.js and C:\Users\YourUserName\.vscode\extensions\leetcode.vscode-leetcode-0.18.1\node_modules\vsc-leetcode-cli\lib\plugins\leetcode.js

For other users, there may be similar files where you can add.

Facing the same issue, I'm using Linux for remote development, after adding process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = 0 to the beginning of leetcode.js, another error occurs.

image

Debonex avatar Dec 19 '23 18:12 Debonex