Open AnWeil opened 2 years ago
Same issue here, on rpi4 raspbian lite
Tried on Windows machine with python 3.9.9 and same error...
I get the same error. Given that the OP has mentioned it was working up to a week ago, I visited https://www.gate.io/docs/apiv4/en/#gate-api-v4-v4-22-2 and there you will see the access URL to the V4 API. (https://api.gateio.ws/api/v4) this is the link that is giving an SSL error, so looks like the error is at their end.
How come it's working for lots of people then??
I tried three other installations now. Even on 3 different networks i always get the above error. I wanted to figure out if it may be a faulty router config.
I don't experience this problem, but could you try downgrading urllib3 as seen here: https://stackoverflow.com/a/66656188
hygren mentioned it didn't work for him on the discord but I would like more people to try it to be sure.
Another idea I have is to provide a http address as the host for the gate_io bot:
The default host is https://api.gateio.ws/api/v4
which uses https, so maybe by forcing http it will work?
Replace in gateio_auth.py
return Configuration(key=auth["gateio_api"], secret=auth["gateio_secret"])
with
return Configuration(key=auth["gateio_api"], secret=auth["gateio_secret"], host="https://api.gateio.ws/api/v4")
I'm personally not really experienced with SSL and HTTPS so these are more or less just random ideas.
Ok i tried downgrading urllib3, but didn't change anything.
adding host to the return command didn't work.
What is the exact command you're running?
the exact command is: nohup python3 main.py & to try the script i just run: python3 main.py so i can see the live output in the terminal
The easiest way to test if the error exists is to run this test script in a new test.py file:
from gate_api import ApiClient, Configuration, SpotApi
client = Configuration()
spot_api = SpotApi(ApiClient(client))
spot_api.list_currencies()
In my case the script just ends, but for some people it causes the same SSL Error.
`pi@raspberrypi:~ $ cat testscript.py from gate_api import ApiClient, Configuration, SpotApi
client = Configuration() spot_api = SpotApi(ApiClient(client)) spot_api.list_currencies() pi@raspberrypi:~ $ python testscript.py Traceback (most recent call last): File "/home/pi/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 597, in urlopen httplib_response = self._make_request(conn, method, url, File "/home/pi/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 343, in _make_request self._validate_conn(conn) File "/home/pi/.local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn conn.connect() File "/home/pi/.local/lib/python3.9/site-packages/urllib3/connection.py", line 349, in connect self.sock = ssl_wrapsocket( File "/home/pi/.local/lib/python3.9/site-packages/urllib3/util/ssl.py", line 359, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.9/ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "/usr/lib/python3.9/ssl.py", line 1040, in _create self.do_handshake() File "/usr/lib/python3.9/ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/testscript.py", line 5, in
pi@raspberrypi:~ $ python --version Python 3.9.2
connecting to a VPN has resolved it for me. probably my wifi network has some weird proxy configured or something
The easiest way to test if the error exists is to run this test script in a new test.py file:
from gate_api import ApiClient, Configuration, SpotApi client = Configuration() spot_api = SpotApi(ApiClient(client)) spot_api.list_currencies()
In my case the script just ends, but for some people it causes the same SSL Error.
The script returns the same wrong_version_number error.
I am running the script on a Raspberry Pi Zero 2 W with Raspbian Lite installed. Everything is updated to the newest Version (Python Version: 3.9.2, did not try 3.10.x). I configured everything and the bot ran fine for a while. Since a week or so i get the following output:
I tried the following: Saved the config files as well as the order.json and made a clean install on the raspberry pi with everything setup again but with no luck. I also updated gate-api, openssl and requests to newest version without luck.
Best regards