The Java HTTP client implements AutoCloseable since JDK 21. Closing the client ensures that asynchronous operations and streams are properly terminated. As we support Java 11, we add any old school "finally" wrapper and conditionally close the client when running on a modern platform.