carloscuesta / gitmoji-cli

A gitmoji interactive cli tool for using emojis on commits. 💻
https://www.npmjs.com/package/gitmoji-cli
MIT License
4.59k stars 206 forks source link

"unable to get local issuer certificate" - Self-signed cert behind corporate proxy #1129

Closed Nixxen closed 1 year ago

Nixxen commented 1 year ago

Describe the bug

This is not strictly related to the CLI, but rather the host cert. I am posting it since there is no issue relating to this currently, and the workarounds are better than no solution at all.

When attempting to update or fetch the emojis behind a corporate proxy, the following error occurs. ✖ Error: FetchError: request to https://gitmoji.dev/api/gitmojis failed, reason: unable to get local issuer certificate

Some brief searches would suggest it is because of a self-signed cert that fails the verification of a proxy verification. https://stackoverflow.com/questions/36494336/npm-install-error-unable-to-get-local-issuer-certificate

There are workarounds that involve disabling strict-ssl (not recommended due to security concerns), or baking your own root cert. Both of these are explained in the SO issue above. Having a verified cert for https://gitmoji.dev/ would probably be best, though I understand the cost of this is not exactly "pocket change".

Reproduction

Be behind a corporate proxy. Attempt to use gitmoji-cli through, i.e., through gitmoji --list. Get error message: ✖ Error: FetchError: request to https://gitmoji.dev/api/gitmojis failed, reason: unable to get local issuer certificate

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
    Memory: 5.73 GB / 31.67 GB
  Binaries:
    Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (114.0.1823.51)
    Internet Explorer: 11.0.19041.1566

Validations

carloscuesta commented 1 year ago

Hey!

Not sure if the proxy option will fix your issue but linking here the related PR in case it helps:

https://github.com/carloscuesta/gitmoji-cli/pull/603

Having a verified cert for https://gitmoji.dev/ would probably be best, though I understand the cost of this is not exactly "pocket change".

Currently the SSL is provided by Vercel automatically that under the hood relies on Let's Encrypt.

The plan is to keep the project "as cheap as possible" as it's not generating any revenue, aside from covering the domain and the server costs!

Another option you can try (if the proxy config is not working for you), can be "self-hosting" your own version of gitmojis. The configuration allows user-defined config, you can define and set your own gitmojisUrl so you'll be able to define a custom list of emojis and host them somewhere else!

Let me know if I can be of any help