You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by fbarbat <fb...@gmail.com> on 2013/05/02 21:01:05 UTC
Truststore in HTTP4 component not working
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.
Re: Truststore in HTTP4 component not working
Posted by Claus Ibsen <cl...@gmail.com>.
What Camel version do you use?
On Thu, May 2, 2013 at 9:04 PM, fbarbat <fb...@gmail.com> wrote:
> I must add it looks like there are two instances of HttpComponent. One is
> configured with SSL context and the other is not. Is that ok?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Truststore-in-HTTP4-component-not-working-tp5731925p5731926.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Truststore in HTTP4 component not working
Posted by fbarbat <fb...@gmail.com>.
I must add it looks like there are two instances of HttpComponent. One is
configured with SSL context and the other is not. Is that ok?
--
View this message in context: http://camel.465427.n5.nabble.com/Truststore-in-HTTP4-component-not-working-tp5731925p5731926.html
Sent from the Camel - Users mailing list archive at Nabble.com.