I am trying to connect to our websocket and get I am getting the following error
Copy code
io.ktor.network.tls.TLSException: Received alert during handshake. Level: FATAL, code: ProtocolVersion
at io.ktor.network.tls.TLSClientHandshake$input$1.invokeSuspend(TLSClientHandshake.kt:70)
The client configuration is
Copy code
val client = HttpClient {
install(WebSockets)
client.webSocket(
urlString = "<wss://sample.com/websocket>",
) {
for (frame in incoming) {
if (frame is Frame.Text) {
val messageJson = frame.readText()
// log
}
}
}
a
Aleksei Tirman [JB]
09/25/2023, 6:10 AM
Unfortunately, I cannot reproduce your problem with the following code:
Copy code
val client = HttpClient {
install(WebSockets)
}
client.webSocket(urlString = "<wss://ws.postman-echo.com/raw>") {
for (frame in incoming) {
if (frame is Frame.Text) {
val messageJson = frame.readText()
}
}
}
s
Sudhanshu Singh
09/25/2023, 8:40 AM
I can see that other websockets work. But
client.websocket
throws error when i connect to my websocket.
is there anyway to enable TLS so that below error isn't thrown?
Copy code
io.ktor.network.tls.TLSException: Received alert during handshake. Level: FATAL, code: ProtocolVersion
at io.ktor.network.tls.TLSClientHandshake$input$1.invokeSuspend(TLSClientHandshake.kt:70)