michalyao / evermonkey

Evernote Editing. Redefined. 关于 token 的问题请去 https://github.com/michalyao/evermonkey/issues/94 中查看!
http://monkey.yoryor.top
MIT License
543 stars 56 forks source link

Self-signed certificate in chain #109

Open subrandom opened 6 years ago

subrandom commented 6 years ago

In a corporate environment with a self-signed certificate, EverMonkey will not sync, read, or write notes to Evernote because it throws an error on encountering the self-signed certificate.

Unfortunately, there isn't anything I can do about the certificate - it is what we use, and I'm stuck with it.

EverMonkey should follow the VSCode setting http.proxyStrictSSL: false. I have that set, and it typically fixes the problem, but EverMonkey seems to be ignoring it?

michalyao commented 6 years ago

@subrandom , Could you please show me the error message? If the message is thrown by vscode, maybe you can find the solution here.

https://github.com/Microsoft/vscode/issues/12588 Maybe vscode lack support for extension proxy now. :disappointed:

subrandom commented 6 years ago

I don’t know if the screenshot will come through. If not, it reads simply:

Unexpected error: {“code”:”Self_Signed_Cert_In_Chain”} Source: evermonkey (Extension)

It’s possible that I’m mis-interpreting the error. Code works for everything else without issue - I can interact with Github and SSH/FTP sites no problem. It only fails for EverMonkey, so I assume that the issue is there.

I’ve tried most of the stuff on the network page already, and I’ve set the company certificates to be fully trusted all the time, but EM still complains.

On Mar 26, 2018, at 9:05 AM, Michal notifications@github.com wrote:

@subrandom https://github.com/subrandom , Could you please show me the error message? If the message is thrown by vscode, maybe you can find the solution here https://code.visualstudio.com/docs/setup/network.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michalyao/evermonkey/issues/109#issuecomment-376158560, or mute the thread https://github.com/notifications/unsubscribe-auth/ADIB3lhvpZ_4wLqObzm9XhFI1TfB5kuUks5tiOecgaJpZM4S7DqX.

michalyao commented 6 years ago

@subrandom See Microsoft/vscode#12588 for detail. The extension can not use vscode's proxy setting now. I'm sorry but I have to say Code makes extensions mostly useless in a corporate world.Problems will be solved easily if the proxy API is provided.

I'm going to report this issue in the evernote-sdk repo, I will ping if the problem has been solved.

subrandom commented 6 years ago

Thanks for the info. I just started using Code recently and I wasn’t aware of the limitation. Hopefully they’ll get that fixed!

On Mar 26, 2018, at 10:32 PM, Michal notifications@github.com wrote:

@subrandom https://github.com/subrandom See Microsoft/vscode#12588 https://github.com/Microsoft/vscode/issues/12588 for detail. The extension can not use vscode's proxy setting now. I'm sorry but I have to say Code makes extensions mostly useless in a corporate world.Problems will be solved easily if the proxy API is provided.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michalyao/evermonkey/issues/109#issuecomment-376376141, or mute the thread https://github.com/notifications/unsubscribe-auth/ADIB3l-Q__TR7Z2GI5khflQrdjG2HlLtks5tiaS3gaJpZM4S7DqX.

michalyao commented 6 years ago

@subrandom , Thanks for @iafan's help, I bypassed self-signed certificate issue. You can download the beta version of evermonkey from here.

Then install the extension via VSIX. image

Hope this will help.

subrandom commented 6 years ago

Hi! I’m sorry to say that did not do anything, but I’m not sure if you linked me to the correct version. The VSIX file reports itself as 2.4.5, which is the same version I had installed already. Maybe that wasn’t the beta?

On Mar 28, 2018, at 4:56 AM, Michal notifications@github.com wrote:

@subrandom https://github.com/subrandom , Thanks for @iafan https://github.com/iafan's help, I bypassed self-signed certificate issue. You can download the beta version of evermonkey from here https://www.dropbox.com/s/1kw25wtee56w1sl/evermonkey-2.4.5.vsix?dl=0.

Then install the extension via VSIX. https://user-images.githubusercontent.com/17451490/38018893-cac39ef4-32a8-11e8-9603-e14a76cf5e02.png Hope this will help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michalyao/evermonkey/issues/109#issuecomment-376812524, or mute the thread https://github.com/notifications/unsubscribe-auth/ADIB3rHrJpFrtajRSayBnojPbH7HA0S_ks5ti1ArgaJpZM4S7DqX.

michalyao commented 6 years ago

Hi, I'm sorry.

I think it's better for you to fork evermonkey and debug yourself since I can't reproduce your environment. And it's easy to do that.

  1. fork evermonkey
  2. use npm install (be sure you have installed node and npm)
  3. open the project in Code
  4. Press F5 to debug

See https://github.com/evernote/evernote-sdk-js/issues/87 for the solution. I guess the last version I provided does not place the process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; code in the right place. You can try to add it in everapi.ts or in the BinaryHTTPTransport code in the evernote sdk(node_modules/evernote/lib/transport).

Although this is not a secure way, but it's ok since we know what we are doing.

Enjoy coding!

michalyao commented 6 years ago

If you have resolved this problem, you can package evermonkey.

  1. npm install -g vsce
  2. vsce package in the project directory

This view package a VSIX file, and you can then install it and override the release version.

subrandom commented 6 years ago

Thank you, I’ll work on that when I have some free time.

On Mar 28, 2018, at 10:02 PM, Michal notifications@github.com wrote:

Hi, I'm sorry.

I think it's better for you to fork evermonkey and debug yourself since I can't reproduce your environment. And it's easy to do that.

fork evermonkey use npm install (be sure you have installed node and npm) open the project in Code Press F5 to debug See evernote/evernote-sdk-js#87 https://github.com/evernote/evernote-sdk-js/issues/87 for the solution. I guess the last version I provided does not place the process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; code in the right place. You can try to add it in everapi.ts or in the BinaryHTTPTransport code in the evernote sdk(node_modules/evernote/lib/transport).

Although this is not a secure way, but it's ok since we know what we are doing.

Enjoy coding!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/michalyao/evermonkey/issues/109#issuecomment-377096519, or mute the thread https://github.com/notifications/unsubscribe-auth/ADIB3gfahMoABcc48Y8BKyGWrVxX_NJBks5tjEDQgaJpZM4S7DqX.