1

I used DefaultAsyncHttpClientConfig to configure connection timeout and SSL context.

DefaultAsyncHttpClientConfig.Builder clientBuilder = Dsl.config()
                    .setConnectTimeout(100)
                    .setKeepAlive(true)
                    .setSslContext(sslContext);

Next, I created an AsyncHttpClient object using Dsl.

AsyncHttpClient client1 = Dsl.asyncHttpClient(clientBuilder);

Next, I hit the service as shown below.

AsyncHttpClient client1 = Dsl.asyncHttpClient(clientBuilder);
            BoundRequestBuilder postRequest = client1.preparePost(BASE_URL)
                    .addHeader("Content-Type", "application/json")
                    .addHeader("x-api-key", transactionKey)
                    .addHeader("Cache-Control", "no-cache")
                    .setBody(reqObj);
ListenableFuture<Response> responseFuture = postRequest.execute();

When I try to read the response from the service I get the 'SslHandler removed before handshake completed' exception.

I should read the JSON response from the service after sending a post request but I get the 'SslHandler removed before handshake completed' exception.

0 Answers0