ckan / datapusher

A standalone web service that pushes data files from a CKAN site resources into its DataStore
GNU Affero General Public License v3.0
77 stars 154 forks source link

HTTPError: [SSL: CERTIFICATE_VERIFY_FAILED] #146

Closed brunoqs closed 7 years ago

brunoqs commented 7 years ago

My ckan configuration uses https, I followed the steps in this tutorial https://github.com/conwetlab/ckanext-oauth2/wiki/Starting-CKAN-over-HTTPs-using-Apache-and-Nginx, the datapusher is setting up for production and I put SSL_VERIFY = False in datapusher_settings.py.

brunoqs commented 7 years ago

Solution:

Change the script /usr/lib/ckan/datapusher/src/datapusher/datapusher/jobs.py in the function def push_to_datastore(task_id, input, dry_run=False): and change the line that has this code response = urllib2.urlopen(request, timeout=DOWNLOAD_TIMEOUT) and replace with that

context = ssl._create_unverified_context()
response = urllib2.urlopen(request, timeout=DOWNLOAD_TIMEOUT, context=context)
metaodi commented 7 years ago

This is probably solved with #145, as there the SSL_VERIFY is being used when making the request for the file.

But maybe you could setup DataPusher to actually verify the correct certificate, as you setup both CKAN and DataPusher.

xznhj8129 commented 3 years ago

NOT fixed on Wine