I am trying to communicate with a server using https
service
I am able to communicate but it takes 2 Secs response time..
Now, I want to reduce time for SSL handshake for every request
So, I want to cache or keep the connection live or create pooling connection..
Any suggestions..
My Code:
static SslConfigurator sslConfig = SslConfigurator
.newInstance()
.securityProtocol("TLS")
.keyStoreFile("/path")
.keyStorePassword("password")
.keyStoreType("JKS")
.trustStoreFile(
"/path");
static SSLContext sslCtx = sslConfig.createSSLContext();
static Client client = ClientBuilder.newBuilder().sslContext(sslCtx).build();
Response response = client.target(target).path(path).request(MediaType.APPLICATION_JSON)
.post(Entity.entity(jsonRequest.toString(), MediaType.APPLICATION_JSON));