Ashish C
Ashish C

Reputation: 77

how to establish 2-way SSL connection from Spring-XD

I am calling a url over Https which uses 2 way authentication. Spring XD is able to accept the server's certificate, however the server also needs SpringXD to present authentication.

I have the certificate with me that SpringXD needs to send to server but dont know exactly where I should configure it ?

I am using http-client processor module to establish a connection over HTTPS.

Appreciate if someone can point me to correct configuration.

Below is my stream : stream create --name hitSSL --definition "jms --destination=readFromQ | http-client --url='''https://remoteHost:remotePort/trafficcontrol/''' --httpMethod=GET | log"

And I get this when trying to hit the URL : :Received fatal alert: handshake_failure; nested exception is javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Upvotes: 1

Views: 521

Answers (1)

Artem Bilan
Artem Bilan

Reputation: 121282

First of all you should create the key store file (JKS) using some key tool and place your certificate file there.

After that you should provide JAVA_OPTS ENV variable to say xd-container shell script to pick up your JKS file:

export JAVA_OPTS=-Djavax.net.ssl.keyStore=mySrvKeystore -Djavax.net.ssl.keyStorePassword=123456
xd-container

or modify xd-container script for the DEFAULT_JVM_OPTS with the same -D options.

No need to do any coding.

Upvotes: 1

Related Questions