Added ssl support + key caching