Sockets secure implementations

Rebased on `master`.
intention of method is not obvious from its name. Suggestion: setSecureCallbackAndOptions()