SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed

   1757   1   1
User Avatar
Member
280 posts
Joined: Aug. 2014
Online
Hello hello,

For reasons I won't go into I am stuck running houdini on a Macbook for a while and while loading up one my files, where I am using TOPs and specifically the "Download File" TOPs node.

in OSX I can't run this anymore due to the following error:

ERROR: <urlopen error certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)>

Error running Python callback 'onCookTask':
Traceback (most recent call last):
File "/Applications/Houdini/Houdini19.0.455/Frameworks/Houdini.framework/Versions/19.0/Resources/houdini/pdg/types/utils/genericfile.py", line 956, in onCookTask
self._download(work_item)
File "/Applications/Houdini/Houdini19.0.455/Frameworks/Houdini.framework/Versions/19.0/Resources/houdini/pdg/types/utils/genericfile.py", line 971, in _download
download = urlopen(url)
File "/Applications/Houdini/Houdini19.0.455/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Applications/Houdini/Houdini19.0.455/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Applications/Houdini/Houdini19.0.455/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/Applications/Houdini/Houdini19.0.455/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/Applications/Houdini/Houdini19.0.455/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1360, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Applications/Houdini/Houdini19.0.455/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1319, in do_open
raise URLError(err)
URLError: <urlopen error certificate verify failed: unable to get local issuer certificate (_ssl.c:1076)>

I have python 3 (3.10) installed and have run the certificate install there, which completed.

Also have to note, all this works perfectly fine without issues on Windows.

I'm not quite sure what Houdini wants and how I fix it, so anyone seen this before?

Thank you
https://www.thomaskchristensen.com [www.thomaskchristensen.com]
User Avatar
Member
14 posts
Joined: Aug. 2019
Offline
I tried the Stackoverflow suggestion [stackoverflow.com] of editing certifi's cacert.pem but it didn't work for me. As a work around I created a Python Script node and added the following code:

import requests
import os.path

file_path = '/path/to/file.json'

if not os.path.isfile(file_path):
    response = requests.get('https://some.url')
    with open(file_path, 'wb') as file:
        file.write(response.content)

And then connected that to an Attribute Create node, creating an Output File attribute setting File Path to the same as above.

An alternative to the Python Script node is a Generic Generator node with Command set to
curl https://some.url -o /path/to/file.json
but if you dirty and code the node it will refetch the data even if the file exists.
Edited by HypoSection - Aug. 28, 2022 15:21:48
  • Quick Links