ckan / ckanapi

A command line interface and Python module for accessing the CKAN Action API
Other
176 stars 74 forks source link

Getting SSl Error When using ckanapi with https hosted ckan applications #142

Open rp21buzz opened 4 years ago

rp21buzz commented 4 years ago

SSLError: HTTPSConnectionPool(host='qa-datacatalog.mhf.mhc', port=443): Max retries exceeded with url: /api/action/resource_show (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))

As Stated in a solution in the issue ticket https://github.com/ckan/ckanapi/issues/51 -------- used request_kwargs={'verify':False} forcefully in ckan code file remoteCkan.py.

.action.() This mode of accessing should be enhanced to also take in request_kwargs for now only using call_action we can specify request_kwargs. Does this request make sense
guibos commented 4 years ago

I have the same issue. A possible solution:

import requests
from ckanapi import RemoteCKAN

session = requests.Session()
session.verify = False

demo = RemoteCKAN('your domain', session=session)
rp21buzz commented 4 years ago

cool, this helps but still the action.() call upgrade will help in other scenarios too.