better sslerror encapsulation