1

I have built a client using Apache HTTP Async Client library, I have a pool of http/https requests. The problem is that I need to execute https requests using a Certificate and Client private key. I was able to do that but there is only one SSLContext, so, once I load a Certificate+Private key there, all HTTPS requests to the endpoint are going to use those certificates+key, I need to execute a validation before doing the http request and load the certificate to the request if certain condition is valid, then, I need to be able to load the Certificate+Private key per https request.


    SSLContext context = SSLContext.getInstance("SSL");

      HttpAsyncClient client =
        HttpAsyncClients.custom()            
            .setConnectionManager(manager)
            .setSSLContext(context)
            .build();

Thanks in advance.

Hadesk68
  • 31
  • 3

1 Answers1

1

There is a similar undocumented context attribute http.ioSession-factory-registry that can be used to override the default SchemeIOSessionStrategy on a per request basis.

Use with extreme caution.

ok2c
  • 26,450
  • 5
  • 63
  • 71