Handle memory leak in JRuby by caching certs