LeetCode-OpenSource / vscode-leetcode

Solve LeetCode problems in VS Code
https://marketplace.visualstudio.com/items?itemName=shengchen.vscode-leetcode
MIT License
8.2k stars 648 forks source link

Error: self signed certificate in certificate chain #446

Open rickdgit opened 5 years ago

rickdgit commented 5 years ago

🐛 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

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 commented 5 years ago

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

Still not working

yanglr commented 5 years ago

@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

rickdgit commented 5 years ago

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

rickdgit commented 5 years ago

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

jdneo commented 5 years ago

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. 😄

rickdgit commented 5 years ago

Hi @jdneo

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

jdneo commented 5 years ago

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.

tingfenghanlei commented 5 years ago

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

WeikaiZhou commented 12 months ago

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.

Debonex commented 10 months ago

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