Hi there,
I am encountering an error when attempting to connect to ArcGIS Online. The domain "arcgis.com" has been whitelisted and I am using the pythonanywhere proxy to connect. I have tried using ssl_cerify=False in the connection but no further success.
Here is the connection string:
gis = GIS(proxy_host="proxy.server", proxy_port=3128, verfiy_ssl=False, url="https://worldearth.maps.arcgis.com", username='myusername', password='mypassword')
The error message returned is as follows:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/__init__.py", line 452, in __init__
raise e
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/__init__.py", line 399, in __init__
self._portal = _portalpy.Portal(
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/_impl/_portalpy.py", line 201, in __init__
self.get_properties(True)
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/_impl/_portalpy.py", line 1220, in get_properties
raise e
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/_impl/_portalpy.py", line 1200, in get_properties
resp = self.con.post(path, self._postdata(), ssl=True)
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/_impl/_con/_connection.py", line 933, in post
elif token_as_header == False and self.token is not None: # as ?token=
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/_impl/_con/_connection.py", line 1391, in token
self._token = self._enterprise_token()
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/_impl/_con/_connection.py", line 1535, in _enterprise_token
res = self.post(path=self._token_url, params=postdata, add_token=False)
File "/home/worldearth/.local/lib/python3.8/site-packages/arcgis/gis/_impl/_con/_connection.py", line 1010, in post
raise requests.exceptions.SSLError(
requests.exceptions.SSLError: Please set verify_cert=False due to encountered SSL error: HTTPSConnectionPool(host='worldearth.maps.arcgis.com', port=443): Max retries exceeded with url: /sharing/rest/generateT
oken (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))
I have tested my code on a local environment and it works without issue, I have also tried Python 3.9, 3.8 and 3.6 versions with the arcgis module. All return the same error message.
Any help or support on this would be much appreciated
Thanks!