From the active socket, so for XMPP, through the same way you obtain the TLS information. For SIP, same complicated story as a couple of months ago.

Maybe a new OpSetConnectionInfo would make sense? The OpSetTls could then be derived from it and the isSecure() method (or similar) on the ProtocolProviderService could be moved there.