logging SSL errors correctly