private HttpResponse makeAsyncRequest(ClientInvocation request, boolean buffered) {
        // compose RequestHeaders
        final HttpMethod method = HttpMethod.valueOf(request.getMethod());
        final URI requestUri = request.getUri();
        final String scheme = checkNotNull(requestUri.getScheme(), "scheme: %s", requestUri);
        final String authority = checkNotNull(requestUri.getAuthority(), "authority: %s", requestUri);
        final String path = getServicePath(requestUri);
        final RequestHeadersBuilder requestHeadersBuilder = RequestHeaders.builder()
                                                                          .method(method)
                                                                          .scheme(scheme)
                                                                          .authority(authority)
                                                                          .path(path);
        // copy request headers from ClientInvocation
        request.getHeaders().getHeaders().forEach(requestHeadersBuilder::addObject);
        final RequestHeaders requestHeaders = requestHeadersBuilder.build();

        if (request.getEntity() == null) {
            // if there is no body - execute request and return response
            return client.execute(HttpRequest.of(requestHeaders));
        }

        if (buffered) {
            // Request + Response fully buffered in memory. Future signalled after the entire response
            // received and processed.
            final HttpRequest asyncRequest;
            try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
                request.getDelegatingOutputStream().setDelegate(os);
                request.writeRequestBody(request.getEntityStream());
                asyncRequest = HttpRequest.of(requestHeaders, HttpData.wrap(os.toByteArray()));
            } catch (IOException e) {
                throw new RuntimeException("Failed to write the request body!", e);
            }
            return client.execute(asyncRequest);
        } else {
            // Unbuffered: Future returns immediately after headers. Reading the response-stream blocks,
            // but one may check InputStream#available() to prevent blocking.
            final HttpRequestWriter requestWriter = HttpRequest.streaming(requestHeaders);
            final HttpResponse asyncResponse = client.execute(requestWriter);
            final ByteBufferBackedOutputStream requestContentStream
                    = new ByteBufferBackedOutputStream(bufferSize, buff -> {
                if (buff.isReadable()) {
                    requestWriter.write(HttpData.wrap(buff));
                }
            });
            request.getDelegatingOutputStream().setDelegate(requestContentStream);
            try {
                request.writeRequestBody(request.getEntityStream());
                requestContentStream.close();
            } catch (IOException e) {
                requestWriter.close(e);
                throw new RuntimeException("Failed to write the request body!", e);
            }
            requestWriter.close();
            return asyncResponse;
        }
    }
Armeria does not allow to access the HostnameVerifier from WebClient API.
This functionality must be achieved by configuring {@link com.linecorp.armeria.client.WebClientBuilder}.
@throws UnsupportedOperationException always
resteasy/src/main/java/com/linecorp/armeria/client/resteasy/ArmeriaJaxrsClientEngine.java