Hello all,
Trying out the new ArcGIS Hub API for Python, which is built off the ArcGIS API for Python.
I am attempting to make a connection to our Portal using the following code:
from arcgishub.hub import Hub
dev = Hub("PORTALURL","USERNAME","PASSWORD")
When I do, I get the following error:
_SSLError: Please set verify_cert=False due to encountered SSL error: HTTPSConnectionPool(host='HOSTURL', port=443): Max retries exceeded with url: /WEBADAPTOR/sharing/rest/info?f=json (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (ssl.c:852)'),))
If I try to add "verify_cert=False" to the connection, like so:
dev = Hub("PORTALURL","USERNAME","PASSWORD",verify_cert=False)
I now get the error:
TypeError: init() got an unexpected keyword argument 'verify_cert'
I tried adding our Portal cert to the Windows' Trusted Root certs (mmc.exe), and also tried running the script internally and hitting the FQDN as opposed to the public URL - both with the same result. Also tried Rohit's suggestion here using import ssl and the ssl command: Cannot access my portal usinhg arcgis python api
So in summary, it seems like the Hub API does not support verify_cert like the ArcGIS API does when making a connection to your Portal. My question is two fold then, is there a way to resolve this SSL error in our Portal, or is there a way to bypass the SSL verification with the Hub API.
Thank you,
Eric
Portal for ArcGIS ArcGIS API for Python ArcGIS Hub