-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate #65
Comments
Hi @Fretless14! I just tried on Apple Silicon M1 and it worked as expected. I think the problem is with either outed CA bundle or that it was not installed. Could you please check if the following solution helps? |
I will test it out tonight, thank you! I think on Mac the cert path defaults to a location that is made when you install Python on your computer, which I have on my Mac obviously, so any computer that doesn't have Python installed (running on a .app build), will run into this error, and that script will fix it; I THINK that's what's happening. Will update when I can run my program on another Mac Though I didn't run into that issue on my Windows laptop after I uninstalled Python... so must be a Mac thing with some default Python package/cert. |
I have it implemented, after changing the script slightly to take care of the missing path of the default ssl path for python (only made during python install, won't be there on customer systems) [ignore my logger import]:
However, on another Mac, the original error remains. I'm thinking I need to create an SSL context object for the request function pointing to the cert file? Though I also thought that the above script changes the default path of the CA cert, so default_context should point to the new cert already... idk, I have to spend some time to look into this |
Wow okay, way easier fix. I thought of looking in connection to Pyinstaller, and it was mentioned and resolved here: pyinstaller/pyinstaller#7229 (comment) Simply add this to your project:
This makes it work for me, though I will have to go back and test on my other systems (Windows with and without Python installed) |
@Fretless14 thanks for sharing the solution! I think we might be able to incorporate this into the next release. Just need to test it on Mac and Windows, as well as perform other tests. |
We noticed that certifi is an external dependency that needs to be installed, and we decided not to add this directly into the library and instead provide a solution on the wiki page (https://github.com/Cryptolens/cryptolens-python#could-not-contact-the-server-error-message-urlopen-error-ssl-certificate_verify-_failed-certificate-verify-failed-unable-to-get-local-issuer-certificate-sslc1125). For compatibility reasons, we need to keep the library free from external dependencies, since some of our customers are using it in an environment where external dependencies would cause issues. Based on our discussion, it appears that this issue is specific to some Mac users, likely due to an error during the installation of the Python 3 bundle. It does not seem to affect all Mac users (since it worked on both your machine and mine). Thank you once again for your feedback! |
Hi,
Does this package support Apple's M1/M2 chips?
I have everything working on my Apple Intel and Windows laptops, but I sent my program to a friend that has an M2 Apple laptop and he is getting this error stemming from a package used in cryptolens:
An error occurred: Could not contact the server. Error message: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>
I know this is part of the urllib package, but can someone verify this is an Apple Silicon compatibility issue?
The text was updated successfully, but these errors were encountered: