secure socket working (kind of)