Issue
the script works perfectly on my MacBook however i get error whenever i try to run it on my raspberry pi. I cant seem to find a solution, can someone point me the right direction! please and thanks
`Traceback (most recent call last): File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket cnx.do_handshake() File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1934, in do_handshake self._raise_ssl_error(self._ssl, result) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1671, in _raise_ssl_error _raise_current_error() File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue raise exception_type(errors) OpenSSL.SSL.Error: [('SSL routines', 'tls_process_ske_dhe', 'dh key too small')]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen chunked=chunked, File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request self._validate_conn(conn) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn conn.connect() File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/connection.py", line 394, in connect ssl_context=context, File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 370, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 491, in wrap_socket raise ssl.SSLError("bad handshake: %r" % e) ssl.SSLError: ("bad handshake: Error([('SSL routines', 'tls_process_ske_dhe', 'dh key too small')])",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/requests/adapters.py", line 449, in send timeout=timeout File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api-fxpractice.oanda.com', port=443): Max retries exceeded with url: /v3/accounts/101-004-XXXXXXXX-001/summary (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_ske_dhe', 'dh key too small')])")))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "eurusd.py", line 1, in import bot File "/home/pi/Desktop/Bot/bot.py", line 14, in import oanda File "/home/pi/Desktop/Bot/oanda.py", line 35, in client.request(r) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/oandapyV20/oandapyV20.py", line 306, in request request_args, headers=headers) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/oandapyV20/oandapyV20.py", line 234, in __request raise err File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/oandapyV20/oandapyV20.py", line 231, in __request **request_args) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/requests/sessions.py", line 543, in get return self.request('GET', url, **kwargs) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/requests/sessions.py", line 530, in request resp = self.send(prep, **send_kwargs) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/requests/sessions.py", line 643, in send r = adapter.send(request, **kwargs) File "/home/pi/Desktop/Bot/env/lib/python3.7/site-packages/requests/adapters.py", line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='api-fxpractice.oanda.com', port=443): Max retries exceeded with url: /v3/accounts/101-XXX-XXXXXXX-001/summary (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_ske_dhe', 'dh key too small')])")))`
Solution
After 3 days...
Remove 'CipherString = DEFAULT@SECLEVEL=2' from /etc/ssl/openssl.cnf.
Source: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907788%20for%20more%20i
Answered By - ISHAR Answer Checked By - David Marino (WPSolving Volunteer)