Dumitru Preguza
08/03/2025, 6:43 PMError Domain=NSURLErrorDomain Code=-1011 "There was a bad response from the server." UserInfo={NSErrorFailingURLStringKey=<ws://test.com/rpc>, NSErrorFailingURLKey=<ws://test.com/rpc>, _NSURLLErrorWebSocketHandshakeFailureReasonKey=0, NSLocalizedDescription=There was a bad response from the server.}
Thread in Slack ConversationAlexander Sysoev
08/05/2025, 7:16 AMDumitru Preguza
08/05/2025, 1:16 PMError Domain=NSURLErrorDomain Code=-1011 "There was a bad response from the server." UserInfo={NSErrorFailingURLStringKey=ws://<test>.com/rpc, NSErrorFailingURLKey=ws://<test>.com/rpc, _NSURLLErrorWebSocketHandshakeFailureReasonKey=0, NSLocalizedDescription=There was a bad response from the server.}
CIO client complains:
TLS sessions are not supported on Native platform.
Maybe the CIO TLS session support will be added after this task will be doneDumitru Preguza
08/05/2025, 11:17 PMget<HttpClient>().rpc {
url {
host = "test.com"
encodedPath = "/rpc"
protocol = URLProtocol.WSS //added this line
port = 0 //added this line
}
rpcConfig {
serialization {
json()
}
}
}
Explicitly set that protocol is URLProtocol.WSS (unless it's not secured)
Explicitly set port 0 - this one is weird, DEFAULT_PORT is 0 anyway, but for a reason it transforms to 80, and makes wrong url call in the end: "test.com:80/rpc" however you need "test.com/rpc"
*instead of test.com I use a real domain of a real server on hetzner, backed by traefik.
On Android (CIO impl.) it will work without these changes out of the boxAleksei Tirman [JB]
08/06/2025, 8:41 AMwebsocket
to reproduce the problem?Dumitru Preguza
08/06/2025, 9:38 AMAleksei Tirman [JB]
08/06/2025, 9:55 AMURLProtocol.WSS
protocol explicitly.Dumitru Preguza
08/08/2025, 7:31 PM