Adds support for secureConnect callback and fixes test