I'm getting a "WindowsError: [Error 5] Access is denied" message when running a python script which attempts to make an https connection. The following error message is produced by python:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 431, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 449, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1240, in https_open
context=self._context)
File "C:\Python27\lib\urllib2.py", line 1166, in do_open
h = http_class(host, timeout=req.timeout, **http_conn_args)
File "C:\Python27\lib\httplib.py", line 1258, in __init__
context = ssl._create_default_https_context()
File "C:\Python27\lib\ssl.py", line 440, in create_default_context
context.load_default_certs(purpose)
File "C:\Python27\lib\ssl.py", line 391, in load_default_certs
self._load_windows_store_certs(storename, purpose)
File "C:\Python27\lib\ssl.py", line 378, in _load_windows_store_certs
for cert, encoding, trust in enum_certificates(storename):
WindowsError: [Error 5] Access is denied
It seems to be a permissions problem, but 1.) running the script from a command prompt with admin privileges doesn't fix the issue, and 2.) I really shouldn't have to run a script as admin to do something as basic as establish an https connection.
Any suggestions regarding how to go about addressing this problem?