add an option to clear error before calling ssl methods