Skip to content
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

ssl.SSLError: not enough data: cadata does not contain a certificate #642

Open
Ramitzu opened this issue Dec 13, 2024 · 3 comments
Open
Labels
Bug Something isn't working

Comments

@Ramitzu
Copy link

Ramitzu commented Dec 13, 2024

I am a big noob when it comes to coding and python and everything, and I am sure there are a lot of people who would love to get a solution to this error. Error goes like this:

Traceback (most recent call last):
  File "main.py", line 21, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 378, in exec_module
  File "truststore_init_.py", line 17, in <module>
  File "ssl.py", line 771, in create_default_context
  File "ssl.py", line 592, in load_default_certs
  File "ssl.py", line 584, in _load_windows_store_certs
ssl.SSLError: not enough data: cadata does not contain a certificate (_ssl.c:4015)
@DevilXD DevilXD added the Bug Something isn't working label Dec 13, 2024
@DevilXD
Copy link
Owner

DevilXD commented Dec 13, 2024

Hello,

After doing some digging, the error appears to be caused by an invalid certificate located somewhere in your Windows certificate storage. As this is a part of your operating system, I cannot do anything about it, in terms of fixing anything there myself. The store is managed automatically by every application that handles network requests, and in the miner's case, it's Python itself (through aiohttp and asyncio) that does the handling.

There's two things you can do to possibly resolve this:

  • Per the threads I've found, it seems that a potential fix for this issue has been included in Python 3.11 and 3.12 versions (probably 3.13 as well). Since the minimum Python version won't be upgraded up from 3.10 for this project anytime soon, it means you'd need to install the higher version of Python, and either run the project from source, or compile it into an executable yourself. Some instructions for that can be found here: https://github.com/DevilXD/TwitchDropsMiner/wiki/Setting-up-the-environment,-building-and-running
  • The threads are also suggesting that your system and/ or antivirus program could interfere with Python trying to manage the certificate store, leading to this error. Running the miner with Administrator rights and / or disabling your AV program temporarily could also fix the issue. I doubt it's AV interfering, unless you're getting a detection when running the program, so if running as Admin won't help, running this on a higher Python version would be the only solution.

The references I've found:

python/cpython#79846
python/cpython#104135
https://projects.blender.org/blender/blender/issues/124731

Please let me know if you've managed to resolve the issue.

@DarkRedFish
Copy link

DarkRedFish commented Dec 14, 2024

I also have the same issue since a couple of days, everything was working perfectly fine before. In my case the admin workaround is not working. So i guess I will have to take a little more time to see if your python version proposal is working
Edit: built an exe with python 3.13 using your guide and everything is working fine again. Thanks 👍

@DevilXD
Copy link
Owner

DevilXD commented Dec 15, 2024

I'd need to upgrade the lowest Python version up to 3.12 to fix this bug, per this comment: python/cpython#79846 (comment) As it doesn't qualify as a security fix, it won't be backported to 3.10 or 3.11, even though they're still consider supported.

I guess I'll keep this open until the upgrade. For now, if anyone finds this later: using Python 3.12 to build the executable (or run the miner from source) should help resolve the issue.

@DevilXD DevilXD changed the title Issue when running the EXE file. ssl.SSLError: not enough data: cadata does not contain a certificate Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants