gateio / gateapi-csharp

35 stars 14 forks source link

Error calling List OrderBook: The SSL connection could not be established, see inner exception. #26

Open forReason opened 2 years ago

forReason commented 2 years ago

From time to time I receive this error Message:

The SSL connection could not be established, see inner exception.
Error calling List OrderBook: The SSL connection could not be established, see inner exception.

Line causing the error:

OrderBook requestResult = API._spotApi.ListOrderBook(currencyPair.UnderscoredString, orderDepthAggreation, depthLimit, returnOrderbookId);

whats causing the error or how to mitigate it?

revilwang commented 2 years ago

Seems the connection to the server is not stable. Do you encounter such errors while calling other methods? Where is your client located?

forReason commented 2 years ago

Haven't gotten this error on another method yet. Latency/response time seems quite high with > 1s on average. okx response times are around ~20ms for an orderbook.

Client is located in switzerland on 10gb network connection Edit: also encountered simmilar issue, when trying to open a websocket connection:

Uri host = new Uri("wss://ws.gateio.io/v4/");
Socket = new ClientWebSocket();
Socket.Options.KeepAliveInterval = TimeSpan.FromSeconds(5);
Socket.ConnectAsync(host, CancellationToken.None).Wait();

error:

AuthenticationException: The remote certificate is invalid because of errors in the certificate chain: NotTimeValid

edit2: after a good amount of time digging around with the websocket api issue, I found the Certificate is indeed invalid (out of date) image

Could it be that the API is load balanced and only occasionaly host 2 will provide an answer (with an invalid certificate)?

forReason commented 2 years ago

issue seems to be resolved now,

forReason commented 1 year ago

Coming back to this. As of today, I am unable to open a connection from any of my computers at home.

From my laptop at work, It worked. Different windows 10 cersions are involved. I did a wireshark. The server bumps me, does not accept the client hello: image gateshark.zip

I wonder if thats some kind of ban behaviour? Although Gate works totally fine in the webbrowser