iPhone sending Encrypted Alert packet

Background: I have created a hybrid app in angular using the capacitor library. Everything is working well for the browser and the android mobile app and the iOS mobile app. On the backend, we are using hardware that is acting as a server. The hardware and our mobile are connected to the same router and we are accessing the hardware using an IP address. Also, we have added a self-signed certificate on the hardware and are using HTTPS while communicating with the hardware.

Bug: The only issue we are facing right now with the iOS app is its slowness. I did some digging around the frontend using Wireshark and came to a point where the iOS app is sending the acknowledgment packet followed by an encrypted alert packet when it receives a response from the server. This is happening for every request. After further debugging on the server end I came to know that once it receives an encrypted alert it is closing the socket. Then again it is performing a session handshake, opening the socket again, and then processing the request. So, basically, the below process is repeated every time:

  • Performing session handshake
  • Opening Socket
  • Processing request
  • Sending response
  • Closing the Socket

On the contrary, on an android device, this process is only happening the first time it sends the request and then data transmission is taking place without closing the socket. Below are the screenshots of Wireshark for Android and iOS:

iOS Screenshot:

Android Screenshot:

iPhone sending Encrypted Alert packet
 
 
Q