I have configured the component as a bean or done something like this and
called the method from the route builder:

private void configureSslForHttp4(){
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(keystoreLocation);
ksp.setPassword(keystorePassword);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters scp = new SSLContextParameters();
scp.setTrustManagers(tmp);
HttpComponent httpComponent = getContext().getComponent("https4",
HttpComponent.class);
httpComponent.setSslContextParameters(scp);
}

Mary


Mary Cochran
Red Hat Consulting
mcoch...@redhat.com
(419) 543-0531

On Mon, Oct 23, 2017 at 8:58 AM, Roman Vottner <r...@gmx.at> wrote:

> Hi Steve,
>
> you basically have to define some SSLContextParameters and add them to
> your HttpComponent as hopefully can be seen in the URL below
>
> https://github.com/RovoMe/camel-rest-dsl-with-spring-
> security/blob/master/src/main/java/at/rovo/awsxray/config/
> HttpClientSpringConfig.java <https://github.com/RovoMe/
> camel-rest-dsl-with-spring-security/blob/master/src/main/
> java/at/rovo/awsxray/config/HttpClientSpringConfig.java>
>
> Note that this project is just a playground to test out things and may
> thus change frequently. Don’t get distracted by the custom HttpComponent
> being created at the bottom, I currently work on an AWS XRay support in
> Camel (similar to OpenTracing) and thus need the HttpClientBuilder from AWS
> rather than the Apache Commons HttpClientBuilder.
>
> A sample configuration of the SSLContextParameters which only defines a
> keystone (truststore is analog to this) can be seen here:
> https://github.com/RovoMe/camel-rest-dsl-with-spring-
> security/blob/master/src/main/java/at/rovo/awsxray/config/
> SSLContextConfig.java <https://github.com/RovoMe/
> camel-rest-dsl-with-spring-security/blob/master/src/main/
> java/at/rovo/awsxray/config/SSLContextConfig.java> As this configuration
> is used for Jetty actually, wich does not support TLSv1/1.1 since version
> 9.3 anymore due to a lack of secure ciphers, the majority of lines in this
> configuration are used to add TLSv1/1.1 support, which will become obsolete
> hopefully once Camel 2.19.4 or 2.20.1 (?) will be released.
>
> HTH,
> Roman
>
> > Am 20.10.2017 um 18:52 schrieb Steve973 [via Camel] <
> ml+s465427n5814739...@n5.nabble.com>:
> >
> > Hello.  I'm trying to figure out how to set up the http4 component with
> ssl
> > information (keystore, truststore) with Spring Boot.  I would like to
> have
> > a @Configuration class that configures the "https4" component, but I
> cannot
> > find examples.  Do any of you know of an example that I could look at?
> >
> > Thanks,
> > Steve
> >
> >
> > If you reply to this email, your message will be added to the discussion
> below:
> > http://camel.465427.n5.nabble.com/http4-component-with-
> spring-boot-to-configure-ssl-parameters-tp5814739.html <
> http://camel.465427.n5.nabble.com/http4-component-
> with-spring-boot-to-configure-ssl-parameters-tp5814739.html>
> > To unsubscribe from Camel - Users, click here <http://camel.465427.n5.
> nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=
> 465428&code=cm92b0BnbXguYXR8NDY1NDI4fC04OTkzMjQ3MzM=>.
> > NAML <http://camel.465427.n5.nabble.com/template/
> NamlServlet.jtp?macro=macro_viewer&id=instant_html%
> 21nabble%3Aemail.naml&base=nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.view.web.template.NodeNamespace&breadcrumbs=
> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>

Reply via email to