public static void main(final String[] args) throws Exception {
        final PoolingAsyncClientConnectionManager cm = PoolingAsyncClientConnectionManagerBuilder.create()
                .setTlsConfigResolver(httphost -> TlsConfig.custom()
//                        .setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_1)
//                        .setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_2)
                        .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
                        .build())
                .build();
        try (final CloseableHttpAsyncClient client = HttpAsyncClients.custom()
                .setConnectionManager(cm)
                .build()) {

            client.start();

            final HttpHost target = new HttpHost("https", "httpbin.org");
            final HttpClientContext clientContext = HttpClientContext.create();

            final SimpleHttpRequest request = SimpleRequestBuilder.get()
                    .setHttpHost(target)
                    .setPath("/")
                    .build();

            System.out.println("Executing request " + request);
            final Future<SimpleHttpResponse> future = client.execute(
                    SimpleRequestProducer.create(request),
                    SimpleResponseConsumer.create(),
                    clientContext,
                    new FutureCallback<SimpleHttpResponse>() {

                        @Override
                        public void completed(final SimpleHttpResponse response) {
                            System.out.println(request + "->" + new StatusLine(response));
                            System.out.println("HTTP protocol " + clientContext.getProtocolVersion());
                            final SSLSession sslSession = clientContext.getSSLSession();
                            if (sslSession != null) {
                                System.out.println("SSL protocol " + sslSession.getProtocol());
                                System.out.println("SSL cipher suite " + sslSession.getCipherSuite());
                            }
                            System.out.println(response.getBody());
                        }

                        @Override
                        public void failed(final Exception ex) {
                            System.out.println(request + "->" + ex);
                        }

                        @Override
                        public void cancelled() {
                            System.out.println(request + " cancelled");
                        }

                    });
            future.get();

            System.out.println("Shutting down");
            client.close(CloseMode.GRACEFUL);
        }
    }
This example demonstrates how to make HttpClient negotiate or force a particular
version of HTTP protocol during the TLS handshake.
<p/>
Please note that protocol version policy setting also applies to non-HTTPS
connections.
httpclient5/src/test/java/org/apache/hc/client5/http/examples/AsyncClientHttpVersionPolicy.java