enhanced handling of SSL errors