Fix exception handling when ssl isn't available.