Just installed ArcGIS API for Python 1.2.4 using ArcGIS Pro. I can connect to my production portal that is using CA certificate without any issues, but cannot connect to my development portal that is using self-signed certificate. Both portals are secured by IWA. I have added verify_cert=False, but I am getting the error: "local variable 'resp' referenced before assignment" from the line below...
gis = GIS(portal_url, verify_cert=False)
How can I make this work?
Thanks
Masao
We're looking into this issue. Meanwhile, as a workaround till we have a fix, you may use the following code to bypass certificate verification completely in the Python process:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
from arcgis import GIS
gis = GIS('https://yoururl.com/portal', verify_cert=False)
Please note that this is not for use in production environment, as it bypasses certificate verification in the entire Python process, not just to your portal which is using a self signed certificate.
Thanks for the help I have added the code, and now I am getting a different error...
10061, 'No connection could be made because the target machine actively refused it'
I can still connect to the production site with CA certificate, but not able to connect to the dev site with self-signed certificate.
Hi, Rohit, any update?
I was also getting this problem with arcgis python v1.5.1, installing winKerberos as per 209433 thread fixed it.
This is the thread Leon mentions: