In Apache HTTPClient 4.x, PoolingHttpClientConnectionManager and BasicHttpClientConnectionManager can be used as Connection Managers for HTTP Client. By default, above two Connection Managers load cacerts trust store, from $JRE_HOME/lib/security directory, not programmatically specified.
Since Apache Camel starts supporting HTTP4 Component, camel-http4 is using Apache HTTPClient 4.x. The following is a solution how to customise PoolingHttpClientConnectionManager and SSLContext to use specified KeyStore and TrustStore.
In application.properties file defined environment specified KeyStore and TrustStore:
1 | ... |
Without Connection Managers like PoolingHttpClientConnectionManager and BasicHttpClientConnectionManager in Apache HTTPClient 4.x, Apache Camel Route can be written in this way, binding programmatically specified KeyStore and TrustStore.
References
- Apache Camel HTTP4 Component, http://camel.apache.org/http4.html
- Java SSL with Multiple KeyStores, http://codyaray.com/2013/04/java-ssl-with-multiple-keystores
- Multiple Keystores in Apache Camel/HttpClient, http://codyaray.com/2013/05/multiple-keystores-in-apache-camelhttpclient