Better OpenSSL exceptions handling