Fixes NPE.
Trusts all certs when running tests, as they normally run in headless mode.
Skips adding a listener if already exists.
Clears the current chat transport, only if we are updating the contact, which chat transport is selected as current.