Closed nikisb closed 2 years ago
Picture of a problem https://imgur.com/7SqqEiT
try to run it on administrator privilege, cmd / powershell. look like twitchtube cannot located the cert needed. or I don't know.
I have no idea what you could do to fix this
try this one :
In the file "C:\Users\Nikola\AppData\Local\Programs\Python\Python39\lib\ssl.py", try ~removing~ commenting (#) the two lines (at approximately line 470) starting with:
if certs: self.load_verify_locations(cadata=certs)
credit here :
https://stackoverflow.com/questions/64303580/error-launching-jupyter-notebook-ssl-sslerror-asn1-nested-asn1-error
edit: updated the comment to suit @nikisb ssl.py path
the first one for the user machine, now another thing to test for twitchtube scripts :
Loading cadata in PEM format results in a nested asn1 error. Workaround is to convert cadata to unicode.
Minimum code for reproducing the issue:
>>>import ssl
>>> with open('ca.crt') as f:
... ca_crt = f.read()
...
>>> c = ssl.create_default_context()
>>> c.load_verify_locations(cadata=ca_crt)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ssl.SSLError: nested asn1 error (_ssl.c:2902)
With workaround to make it work:
>>>import ssl
>>> with open('ca.crt') as f:
... ca_crt = f.read()
...
>>> c = ssl.create_default_context()
>>> c.load_verify_locations(cadata=unicode(ca_crt))
The issue is annoying as the documentation explicitly states cadata to be "either an ASCII string of one or more PEM-encoded certificates...". Furthermore the unicode function is not present in Python 3.x, making the workaround version-dependent.
from : https://bugs.python.org/issue37079
I dont know why, but for some reason when i start script i only get these errors.