I use the following code:
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("truststore_test.jks");
ksp.setPassword("password");
TrustManagersParameters trustManagersParameters = new
TrustManagersParameters();
trustManagersParameters.setKeyStore(ksp);
SSLContextParameters scp = new SSLContextParameters();
scp.setTrustManagers(trustManagersParameters);
HttpComponent httpComponent = camelContext.getComponent("http4",
HttpComponent.class);
httpComponent.setSslContextParameters(scp);
After that I configure services and routes. However, when Camel is
registering a port in this part of the code:
@SuppressWarnings("deprecation")
protected void registerPort(boolean secure, X509HostnameVerifier
x509HostnameVerifier, int port, SSLContextParameters sslContextParams)
throws Exception {
SchemeRegistry registry =
clientConnectionManager.getSchemeRegistry();
if (secure) {
SSLSocketFactory socketFactory;
if (sslContextParams == null) {
socketFactory = SSLSocketFactory.getSocketFactory();
} else {
socketFactory = new
SSLSocketFactory(sslContextParams.createSSLContext());
}
...
sslContextParams is null so it doesn't use the truststore.
What could be happening?
Thanks.
--
View this message in context:
http://camel.465427.n5.nabble.com/Truststore-in-HTTP4-component-not-working-tp5731925.html
Sent from the Camel - Users mailing list archive at Nabble.com.