Fixed an issue where a blocking SSL tunnel handshake would freeze the agent's tunnel controller,
causing tunnel teardown to time out and leaving the agent in a
stuck state that rejected all new tunnel connections until the
service was restarted. This would surface during rapid
reconnection cycles, such as after a device wakes from sleep.
The SSL handshake now runs asynchronously, and pending socket
operations are canceled promptly during disconnect, so tunnel
teardown completes cleanly and the agent recovers on its own
without requiring a service restart. |