Does anybody know what has just happent to Websocket4Net on Binance futures? I have been using it more that 2 years and all of the sudden from a few hours ago I keep getting the erro: “A call to SSPI failed, see inner exception”. I use Websocket4Net for market stream. The base uri is: wss://fstream.binance.com and the binance Doc page is: Connect | Binance Open Platform
and here is the GitHub link of Websocket4Net: GitHub - kerryjiang/WebSocket4Net: A popular .NET WebSocket Client
Do you know any alternative for Websocket4Net? Thank you.
Hey,
could you share the inner exception
returned in the error?
Hi,
InnerException = {“The function requested is not supported”}
No matter you stream the aggregate or kline data. After opening the websocket4Net, it gives the error and closes. It stoped working from yesterday. I’ve been using the exactly same code for more than 2 years without any problem.
Could you give more details on the request you are making? (e.g: the handshake parameters and url)
Dim Uri = “wss://fstream.binance.com/ws”
Dim WSK = New WebSocket4Net.WebSocket(Uri)
WSK.ReceiveBufferSize = 131072
WSK.AutoSendPingInterval = 120
WSK.EnableAutoSendPing = True
WSK.NoDelay = True
WSK.Open()
After the Open method it throw the error. Here is the error handeling:
Private Sub WSK_Error(sender As Object, e As ErrorEventArgs) Handles WSK.[Error]
Console.WriteLine(Now.ToString(“yyyy-MM-dd HH:mm:ss.fff”) + " WSK Error: " + e.Exception.Message + vbNewLine)
WSK.Close()
End Sub
I just checked and found that it works on Spot market. That is, if you change the uri to “wss://stream.binance.com:9443/ws” which is for Spot market, it works. So the problem is on Futures end point?!
I checked the Binance Docs and did not find any recent change on address.
I found the solution. You need to set the security property of the socket to None:
YOURSOCKET.Security.EnabledSslProtocols = System.Security.Authentication.SslProtocols.None
Now it works as before.