We have a proxy for all our web traffic and use the proxy_host/proxy_port parameters when connecting to AGOL from Notebooks in Pro. This worked fine until we upgraded to Pro 2.8 and we now receive SSL errors:
---------------------------------------------------------------------------
SSLError Traceback (most recent call last)
In [3]:
Line 1: gis = GIS(proxy_host='XXX.XXXXXXXX.XX', proxy_port=XXXX, verify_cert=False)
File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\__init__.py, in __init__:
Line 359: raise e
File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\__init__.py, in __init__:
Line 343: trust_env=kwargs.get("trust_env", None))
File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_portalpy.py, in __init__:
Line 173: self.get_properties(True)
File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_portalpy.py, in get_properties:
Line 1138: raise e
File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_portalpy.py, in get_properties:
Line 1126: resp = self.con.post(path, self._postdata(), ssl=True)
File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in post:
Line 690: "Please set verify_cert=False due to encountered SSL error: %s" % err)
SSLError: Please set verify_cert=False due to encountered SSL error: HTTPSConnectionPool(host='www.arcgis.com', port=443): Max retries exceeded with url: /sharing/rest/portals/self (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1091)')))
---------------------------------------------------------------------------
The URLs for both HTTP and HTTPS traffic are the same for our proxy.
Has anyone else encountered this?
Solved! Go to Solution.
Long enough. I've just been told by Esri Canada that the fix will show up in version 2.0.1 sometime in June/July.
anyone found solution with the 2.9 ?
we are still cant move from 2.7
I still have this issue with 2.9
Hi,
I found a solution for arcgisPro 2.9.2. In my project we use the arcgis.gis.server.server() to make the new request see https://developers.arcgis.com/python/api-reference/arcgis.gis.server.html. In there there is a parameter that is setting the difference between HTTPS and HTTP. Apperantly the default is True (or it needs to be explicitly mentioned to be false). In my case adding the parameter to false fixed the problem. It would be better of course to use the HTTPS.
The real root cause is the update of the Urllib3 python library. In v1.25.x HTTPS was not supported and every hTTPS call you did was transformed to HTTP. But in v1.26.x is is supported and you should update your calls. I suppose Arcgis Pro 2.7 has the 1.125 version and the 2.8/9 had the 1.26 version but I haven't checket that. https://github.com/urllib3/urllib3/issues/1850.
with version 2.0.1 of the api
this method of using the proxy is the only one that working
# Usage Exmaple 9: Using a Proxy
proxy = {
'http': 'http://10.10.1.10:3128',
'https': 'http://10.10.1.10:1080',
}
gis = GIS(proxy=proxy)
we can move to arcgis pro 3
Did you test it with ArcGIS Pro 3? Anyone?
Ah, thanks for clarifying, I misunderstood. And thanks for posting the solution!