iOS 15 WKWebView websocket behaviour

Hello,

in our app we are reliant on a web socket inside a WKWebview. In previous releases this web socket worked well. In the iOS 15 betas though this web socket behaves differently: it connects to our server successfully but once the client tries to send any data through it the web socket throws an error and closes with a non descriptive error:

The operation couldn’t be completed. (kNWErrorDomainPOSIX error 54 - Connection reset by peer)

Looking into the system log the deepest error I can make out is:

nw_protocol_boringssl_error(1772) [C12.1.1:2][0x102e0d540] Lower protocol stack error post TLS handshake. [54: <private>]

A test web socket to another server seems to be working.

I also notices that a MitM proxy like Charles no longer shows web socket connections in the iOS 15 beta. This just indicates that something might have changed.

Because the communication via this socket is very important for the functionality of our app I must know what the issue is. I tried adding ATS exceptions for the URL of the socket to no avail.

Maybe this is a temporary bug in iOS 15 that will be fixed until its released? Or maybe anyone has experienced this kind of error in the past?

I came from this question

https://github.com/socketio/socket.io/issues/4263

In IOS 15 environment, WSS cannot connect, but WS can link. No matter how to replace the certificate, the result of TLS is the same!

This problem has plagued us for a long time! Hope to get attention!

Yea

iOS 15 WKWebView websocket behaviour
 
 
Q