Sockets secure implementations

Rebased on `master`.
add a comment saying what will happen by doing this.