I'm trying to connect to my api, but when I try to fetch access token () or just make a simple request to the endpoint /oauth/authorize, I receive this error :
Traceback (most recent call last):
File "venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
conn.connect()
File "venv/lib/python3.6/site-packages/urllib3/connection.py", line 356, in connect
ssl_context=context)
File "venv/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 372, in ssl_wrap_socket
return context.wrap_socket(sock)
File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/usr/lib/python3.6/ssl.py", line 814, in __init__
self.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "venv/lib/python3.6/site-packages/requests/adapters.py", line 445, in send
timeout=timeout
File "venv/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "venv/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /oauth/authorize?response_type=code&client_id=&state=8SJIlHps6ehUrQhaKQ7h5ADS5o0CZo (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "api.py", line 14, in <module>
session.fetch_access_token(uri)
File "venv/lib/python3.6/site-packages/authlib/client/oauth2_session.py", line 184, in fetch_access_token
withhold_token=True)
File "venv/lib/python3.6/site-packages/requests/sessions.py", line 559, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "venv/lib/python3.6/site-packages/authlib/client/oauth2_session.py", line 296, in request
method, url, auth=auth, **kwargs)
File "venv/lib/python3.6/site-packages/requests/sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "venv/lib/python3.6/site-packages/requests/sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "venv/lib/python3.6/site-packages/requests/adapters.py", line 511, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /oauth/authorize?response_type=code&client_id=&state=8SJIlHps6ehUrQhaKQ7h5ADS5o0CZo (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)'),))
' Connection reset by peer ' socket error don't work to me. I'm using a https connection locally and the default server from Flask. Some tips ?
Update :
I did try to set the ssl of two ways :
1 º :
import ssl
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain('127.0.0.1+1.pem', '127.0.0.1+1-key.pem')
app.run(ssl_context=context)
2 º :
app.run(ssl_context=('127.0.0.1+1.pem', '127.0.0.1+1-key.pem'))
Related
I am getting this error:
Traceback (most recent call last):
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/urllib3/connection.py", line 416, in connect
self.sock = ssl_wrap_socket(
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.example.com', port=8080): Max retries exceeded with url: /geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=qazqoinau_test%3A%D0%93%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0%20%D0%A0%D0%B5%D1%81%D0%BF%D1%83%D0%B1%D0%BB%D0%B8%D0%BA%D0%B8%20%D0%9A%D0%B0%D0%B7%D0%B0%D1%85%D1%81%D1%82%D0%B0%D0%BD&STYLES=qazqoinau_test%3Alayers_border_RK&SRS=EPSG%3A3857&CRS=EPSG%3A3857&TILED=true&access_token=JNkYj4bIfuWQbQu06AAF2MUxc9banx&WIDTH=512&HEIGHT=512&BBOX=2504688.542848654%2C2504688.542848654%2C5009377.08569731%2C5009377.08569731 (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url,verify=False,**kwargs)
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/home/adminko/.geonodevirtaulenvs/geonode/lib/python3.8/site-packages/requests/adapters.py", line 563, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.example.com', port=8080): Max retries exceeded with url: /geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=qazqoinau_test%3A%D0%93%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0%20%D0%A0%D0%B5%D1%81%D0%BF%D1%83%D0%B1%D0%BB%D0%B8%D0%BA%D0%B8%20%D0%9A%D0%B0%D0%B7%D0%B0%D1%85%D1%81%D1%82%D0%B0%D0%BD&STYLES=qazqoinau_test%3Alayers_border_RK&SRS=EPSG%3A3857&CRS=EPSG%3A3857&TILED=true&access_token=JNkYj4bIfuWQbQu06AAF2MUxc9banx&WIDTH=512&HEIGHT=512&BBOX=2504688.542848654%2C2504688.542848654%2C5009377.08569731%2C5009377.08569731 (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)')))
How can I disable checking this SSL verification or how can I handle this error (consequences after changing )? I am ready to change package code to handle this error. Everything was working when I was using HTTP connection.
I have already changed request.get(verify = False)
my code
import requests
requests.get('https://www.example.com:8080/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=qazqoinau_test%3A%D0%93%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0%20%D0%A0%D0%B5%D1%81%D0%BF%D1%83%D0%B1%D0%BB%D0%B8%D0%BA%D0%B8%20%D0%9A%D0%B0%D0%B7%D0%B0%D1%85%D1%81%D1%82%D0%B0%D0%BD&STYLES=qazqoinau_test%3Alayers_border_RK&SRS=EPSG%3A3857&CRS=EPSG%3A3857&TILED=true&access_token=JNkYj4bIfuWQbQu06AAF2MUxc9banx&WIDTH=512&HEIGHT=512&BBOX=2504688.542848654%2C2504688.542848654%2C5009377.08569731%2C5009377.08569731')
I'm actually trying to use "paddleocr" with python
I use a conda environnement
i followed the guide on their github : https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.5/doc/doc_en/quickstart_en.md
But when i try to execute this command :
(paddle_env) C:\Windows\system32>paddleocr --image_dir "path\image" --use_angle_cls true --lang en --use_gpu false
i get this error :
download https://paddleocr.bj.bcebos.com/PP-OCRv3/english/en_PP-OCRv3_det_infer.tar to C:\Users\PD/.paddleocr/whl\det\en\en_PP-OCRv3_det_infer\en_PP-OCRv3_det_infer.tar
Traceback (most recent call last):
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\urllib3\connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\urllib3\util\ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\urllib3\util\ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\requests\adapters.py", line 489, in send
resp = conn.urlopen(
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\urllib3\util\retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='paddleocr.bj.bcebos.com', port=443): Max retries exceeded with url: /PP-OCRv3/english/en_PP-OCRv3_det_infer.tar (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\PD\anaconda3\envs\paddle_env\Scripts\paddleocr.exe\__main__.py", line 7, in <module>
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\paddleocr\paddleocr.py", line 571, in main
engine = PaddleOCR(**(args.__dict__))
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\paddleocr\paddleocr.py", line 420, in __init__
maybe_download(params.det_model_dir, det_url)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\paddleocr\ppocr\utils\network.py", line 55, in maybe_download
download_with_progressbar(url, tmp_path)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\paddleocr\ppocr\utils\network.py", line 26, in download_with_progressbar
response = requests.get(url, stream=True)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\requests\sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\requests\sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "C:\Users\PD\anaconda3\envs\paddle_env\lib\site-packages\requests\adapters.py", line 563, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='paddleocr.bj.bcebos.com', port=443): Max retries exceeded with url: /PP-OCRv3/english/en_PP-OCRv3_det_infer.tar (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)')))
paddleocr version : 2.5.0.3
python version : 3.8.13
It seems that you can not access the downlink provided by PaddleOCR, you can try to download the models on its mainpage, set rec_model_dir and det_model_dir mannually. (link)
demo image
I have been working on some scripts in python and on https connections I get issue of SSL certificates, especially the self-signed ones. Those are easily over come this particular issue I have with one server is off too weak certificate. Now the server is known to me but not owned by me so I cannot change the certificate. Is there a way to overcome this? I am using a Macbook and the library is an SDK of Solarwinds
Traceback (most recent call last):
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 453, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls)
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/urllib3/util/ssl_.py", line 495, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 513, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1071, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1342, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:997)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
resp = conn.urlopen(
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
retries = retries.increment(
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='10.1.6.200', port=17778): Max retries exceeded with url: /SolarWinds/InformationService/v3/Json/Query (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:997)')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/networkautomator/VENV/sdkorion/query_test_2.py", line 14, in <module>
results = swis.query("SELECT NodeID, DisplayName, NodeDescription FROM Orion.Nodes Where SysName LIKE 'VELO%'")
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/orionsdk/swisclient.py", line 23, in query
return self._req(
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/orionsdk/swisclient.py", line 52, in _req
resp = self._session.request(method,
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/Users/networkautomator/VENV/sdkorion/lib/python3.10/site-packages/requests/adapters.py", line 563, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='10.20.5.1', port=17778): Max retries exceeded with url: /SolarWinds/InformationService/v3/Json/Query (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:997)')))
All help regarding this will be appreciated.
Thanks
I'm trying to onboard a simple python model from CLI as shown in the related tutorial.
After providing the onboarding token (user:api-token) I'm getting the error below.
The Acumos platform has been deployed using the AIO tools using prep-deploy process.
I was able to dump the same model and onboard using the web UI.
Traceback (most recent call last):
File "/home/gprato/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 677, in urlopen
chunked=chunked,
File "/home/gprato/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 381, in _make_request
self._validate_conn(conn)
File "/home/gprato/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
conn.connect()
File "/home/gprato/.local/lib/python3.6/site-packages/urllib3/connection.py", line 371, in connect
ssl_context=context,
File "/home/gprato/.local/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 384, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/usr/lib/python3.6/ssl.py", line 817, in __init__
self.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/gprato/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/gprato/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 727, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/home/gprato/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='***', port=443): Max retries exceeded with url: /onboarding-app/v2/models (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "simple_example.py", line 16, in <module>
session.push(model, 'example-2')
File "/home/gprato/.local/lib/python3.6/site-packages/acumos/session.py", line 103, in push
_push_model(dump_dir, self.push_api, self.auth_api, options, extra_headers=extra_headers)
File "/home/gprato/.local/lib/python3.6/site-packages/acumos/session.py", line 172, in _push_model
_post_model(files, push_api, auth_api, tries, max_tries, extra_headers, options)
File "/home/gprato/.local/lib/python3.6/site-packages/acumos/session.py", line 192, in _post_model
resp = requests.post(push_api, files=files, headers=headers)
File "/home/gprato/.local/lib/python3.6/site-packages/requests/api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "/home/gprato/.local/lib/python3.6/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/home/gprato/.local/lib/python3.6/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/home/gprato/.local/lib/python3.6/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/home/gprato/.local/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='***', port=443): Max retries exceeded with url: /onboarding-app/v2/models (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))
UPDATE
I've solved by adding the following line into the python script:
os.environ['CURL_CA_BUNDLE'] = ""
In addition to that I also had to change the push url ("acumos/onboarding-app/v2/models") as it was wrongly reported in the acumos python client library ("acumos/onboarding-app/v2/push").
I recomend you to add the following in your python script
os.environ['CURL_CA_BUNDLE'] = ""
it will skip the certificate verification
My Editor is PyCharm 2017.3 and my Python version is 3.4.
I trying to translate the word clicked on my application from english to hindi.
This application scraps words from a site and lists it.Everything is working fine with this application except the translation feature.
I have just installed googletrans library but it is giving me error that goes like max no of retries exceeded.
def translate(self):
translate=Translator()
translate.translate(self._word, dest="hi",src="en")
Here is my translate function and here is the documentation I am referring to.
This is my Error showing in console.
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\urllib3\connectionpool.py", line 601, in urlopen
chunked=chunked)
File "C:\Python34\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
self._validate_conn(conn)
File "C:\Python34\lib\site-packages\urllib3\connectionpool.py", line 850, in _validate_conn
conn.connect()
File "C:\Python34\lib\site-packages\urllib3\connection.py", line 326, in connect
ssl_context=context)
File "C:\Python34\lib\site-packages\urllib3\util\ssl_.py", line 329, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Python34\Lib\ssl.py", line 344, in wrap_socket
_context=self)
File "C:\Python34\Lib\ssl.py", line 540, in __init__
self.do_handshake()
File "C:\Python34\Lib\ssl.py", line 767, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Python34\lib\site-packages\requests\adapters.py", line 440, in send
timeout=timeout
File "C:\Python34\lib\site-packages\urllib3\connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Python34\lib\site-packages\urllib3\util\retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='translate.google.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)'),))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/ROCKSTAR/PycharmProjects/Dictionary/execute.py", line 56, in getPerWordDisplay
self.query.value(4), self.query.value(5))
File "C:\Users\ROCKSTAR\PycharmProjects\Dictionary\PerWordWindow.py", line 23, in __init__
self.translate()
File "C:\Users\ROCKSTAR\PycharmProjects\Dictionary\PerWordWindow.py", line 37, in translate
translate.translate(self._word, dest="hi",src="en")
File "C:\Python34\lib\site-packages\googletrans\client.py", line 132, in translate
data = self._translate(text, dest, src)
File "C:\Python34\lib\site-packages\googletrans\client.py", line 57, in _translate
token = self.token_acquirer.do(text)
File "C:\Python34\lib\site-packages\googletrans\gtoken.py", line 180, in do
self._update()
File "C:\Python34\lib\site-packages\googletrans\gtoken.py", line 57, in _update
r = self.session.get(self.host)
File "C:\Python34\lib\site-packages\requests\sessions.py", line 521, in get
return self.request('GET', url, **kwargs)
File "C:\Python34\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python34\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Python34\lib\site-packages\requests\adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='translate.google.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)'),))
Process finished with exit code 0
It seems to be a connection error or maybe a certificate error. Its not a code error, Somehow the google server did not return a response. Try to wait some time or search for some kind of certificate, maybe they block too many requests to not overflow the server. The same issue happen to me and I wait 30min and the error was gone...