For my company's project, i need to use ESRI arcgis python API to access the data in our Enterprise ArcGIS portal. After installing the arcgis library, i did a test of the connection via GIS(). the code looks as below
gis = GIS( profile="link to the portal",username ="username",password="password",verify_cert = False ,proxy_host='username:password@proxy_host',proxy_port=proxy_port)
But it gives me an error as below
Please set verify_cert=False due to encountered SSL error: HTTPSConnectionPool(host='www.arcgis.com', port=443😞 Max retries exceeded with url: /sharing/rest/generateToken (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)')))
The error still exists even though i set verify_cert = False Also i tried to set the proxy in the environment beforehand
os.environ['https_proxy'] = "http://proxy"
No luck as well. my openssl version is OpenSSL 1.1.1k 25 Mar 2021- It's very appreciate if anyone could provide me some solutions
Solved! Go to Solution.
Hi @Mumulin96, you mention you are connecting to your Enterprise Portal, but you omit the url argument and use profile instead. Is this intentional?
Does the following provide a different error message?
gis = GIS(url="link to the portal",
username="username",
password="password",
verify_cert = False ,
proxy_host='username:password@proxy_host',
proxy_port=proxy_port)
Hi @Mumulin96, you mention you are connecting to your Enterprise Portal, but you omit the url argument and use profile instead. Is this intentional?
Does the following provide a different error message?
gis = GIS(url="link to the portal",
username="username",
password="password",
verify_cert = False ,
proxy_host='username:password@proxy_host',
proxy_port=proxy_port)
I tried to change but the error still be the same.
even though i tried this
gis = GIS( verify_cert = False ,proxy_host='username:password@proxy_host',proxy_port=proxy_port
It works after i delete the proxy setting. the code looks as below.
gis = GIS( url="link to the portal",username ="username",password="password",verify_cert = False )
Many thanks. It saves my day!
Hello,
I am getting this error with your code
ConnectionError: A connection error has occurred: HTTPSConnectionPool(host='myorg.maps.arcgis.com', port=443): Max retries exceeded with url: /sharing/rest/generateToken (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001EB4CC5F448>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
any suggestions?