Small bug fix for secure socket