upradeToSslSocket method
Implementation
Future<void> upradeToSslSocket() async {
_socketStreamSubscription.pause();
final secureSocket = await SecureSocket.secure(_socket);
log('now using secure connection.', initial: initialApp);
await _socketStreamSubscription.cancel();
isSocketClosingExpected = true;
_socket.destroy();
isSocketClosingExpected = false;
connect(secureSocket);
}