error handler and starttls lib abstracted