allows persistent or in-memory caching of fetched certificates
fixed possible refcounting bugs generic return_null() implementation