Hi,
I've been using a wrapper that enables TLS Mutual Authorization around CouchDB. From the client to connecto to this CouchDB I had to set the custom SSL Factory to send the right keys and so on. I'm adding the code below. The issue that showed up is that the client is not reusing/pooling the connections anymore when SSL is enabled and custom SSL Factory is configured in it. The wrapper around couchDB (which is actually Bluemix Secure Gateway in case it matters) let's me monitor incoming connections, and I can see that each call from the client generates a new connection, something that doesn't happen with SSL turned off.
Anyone can give me a hint on how to fix this? I've discarded it's the wrapper fault since it works without problem with okhttp3 calls. I know that some people use the Apache HttpClient instead of Ektorp StdHttpClient. Any code on how to do that?
Here's my current code:
@PostConstruct
private void init() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, KeyManagementException, UnrecoverableKeyException {
}
private KeyStore loadKeyStore() throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
InputStream instream = this.keyStoreResource.getInputStream();
keyStore.load(instream, keyStorePassword.toCharArray());
instream.close();
return keyStore;
}
Thanks in advance, Hernan