generative-ai icon indicating copy to clipboard operation
generative-ai copied to clipboard

fix: prevent SSLCertVerificationError when creating websocket to server

Open gkcng opened this issue 1 year ago • 2 comments

Description

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • [X ] Follow the CONTRIBUTING Guide.
  • [ ] You are listed as the author in your notebook or README file.
    • [ ] Your account is listed in CODEOWNERS for the file(s).
  • [X] Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
  • [ ] Ensure the tests and linter pass (Run nox -s format from the repository root to format).
  • [ ] Appropriate docs were updated (if necessary)

The Fix:

The following error was encountered when "Connect" was pressed:

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

The fix is to use certifi and make sure ssl_context using certifi is passed into the websocket creation.

gkcng avatar Dec 12 '24 11:12 gkcng

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot https://conventionalcommits.org/

Holding off on merging til more tests are done on this -- thanks!

polong-lin avatar Dec 12 '24 19:12 polong-lin

Confirmed it was a local cert problem on my machine, user env problem, not the code.

gkcng avatar Dec 13 '24 02:12 gkcng