SSLContextParameters value injection with a static method invocation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SSLContextParameters value injection with a static method invocation

Onder SEZGIN
Hi,

I have sslContextParameters as below as an example.

    <camel:sslContextParameters
      id="sslContextParameters">
    <camel:keyManagers
        keyPassword="{{ssl.keymanager.pass}}">
      <camel:keyStore
          resource="C:\\Program
Files\\Java\\jdk1.8.0_161\\jre\\lib\\security\\cacerts"
          password="{{ssl.keystore.pass}}"/>
    </camel:keyManagers>
  </camel:sslContextParameters>

and i have the requirement that those {{ssl.keymanager.pass}} and
{{ssl.keystore.pass}} values which are stored in an encrypted format.
And i want to decrypt them and then inject their values to password
attributes in this xml definition.

I have a single method which i can find out the decrypted value, but not
sure how i can inject.
I think only properties components with {{ is supported whereas SPEL is not.

I tried like this;

<camel:sslContextParameters
      id="sslContextParameters">
    <camel:keyManagers
        keyPassword="#{ T(MY_PACKAGE).decrypt('${ssl.keystore.pass}')}">
      <camel:keyStore
          resource="C:\\Program
Files\\Java\\jdk1.8.0_161\\jre\\lib\\security\\cacerts"
          password="#{ T(MY_PACKAGE).decrypt('${ssl.keystore.pass}')}"/>
    </camel:keyManagers>
  </camel:sslContextParameters>

Is there any other way i can inject?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: SSLContextParameters value injection with a static method invocation

Onder SEZGIN
Okay, using

<bean id="sslContextParameters"
class="org.apache.camel.util.jsse.SSLContextParameters">

and injecting camelContext to it helped me.
Thanks.

On Tue, Oct 9, 2018 at 11:55 AM Onder SEZGIN <[hidden email]> wrote:

> Hi,
>
> I have sslContextParameters as below as an example.
>
>     <camel:sslContextParameters
>       id="sslContextParameters">
>     <camel:keyManagers
>         keyPassword="{{ssl.keymanager.pass}}">
>       <camel:keyStore
>           resource="C:\\Program
> Files\\Java\\jdk1.8.0_161\\jre\\lib\\security\\cacerts"
>           password="{{ssl.keystore.pass}}"/>
>     </camel:keyManagers>
>   </camel:sslContextParameters>
>
> and i have the requirement that those {{ssl.keymanager.pass}} and
> {{ssl.keystore.pass}} values which are stored in an encrypted format.
> And i want to decrypt them and then inject their values to password
> attributes in this xml definition.
>
> I have a single method which i can find out the decrypted value, but not
> sure how i can inject.
> I think only properties components with {{ is supported whereas SPEL is
> not.
>
> I tried like this;
>
> <camel:sslContextParameters
>       id="sslContextParameters">
>     <camel:keyManagers
>         keyPassword="#{ T(MY_PACKAGE).decrypt('${ssl.keystore.pass}')}">
>       <camel:keyStore
>           resource="C:\\Program
> Files\\Java\\jdk1.8.0_161\\jre\\lib\\security\\cacerts"
>           password="#{ T(MY_PACKAGE).decrypt('${ssl.keystore.pass}')}"/>
>     </camel:keyManagers>
>   </camel:sslContextParameters>
>
> Is there any other way i can inject?
>
> Thanks.
>
>
>