theJayTea / WritingTools

The world's smartest system-wide grammar assistant; a better version of the Apple Intelligence Writing Tools. Works with the free Gemini API, local LLMs, and other cloud providers.
GNU General Public License v3.0
392 stars 21 forks source link

SSL Handshake Failed #26

Open myn opened 5 hours ago

myn commented 5 hours ago

Getting this error upon triggering a query:

image

I am on a Windows 11 Laptop that goes through a corporate firewall. No issues hitting https://generativelanguage.googleapis.com/ through the web browser.

theJayTea commented 4 hours ago

That’s unfortunate. Do you have corporate security software on your device, which may be blocking requests from specific apps (like this new one)? It’s unable to reach the Gemini API, which means that the request is getting blocked somewhere along the chain with the firewall set-up.

Local LLMs should work, though, and it may be worth seeing if the OpenAI API works if you have credits there.

myn commented 43 minutes ago

Oddly enough I don't have any issues with other apps reaching out to HTTPS enabled endpoints.

Did some googling and found this:

https://stackoverflow.com/a/55320969

https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Python-How-to-disable-SSL-certificate-verification/td-p/113697

https://stackoverflow.com/questions/52032090/mcafee-python-script-ssl-failed-to-verify

import ssl
try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    # Legacy Python that doesn't verify HTTPS certificates by default
    pass
else:
    # Handle target environment that doesn't support HTTPS verification
    ssl._create_default_https_context = _create_unverified_https_context

This URL gives some other resolutions: https://sslinsights.com/fix-certificate-verify-failed-error-in-python/