SSL fixes & debugging helpers