How to install TLS certificate on tomcat that way so it is able to connect to two-way-ssl application

0

I'm trying to integrate with webservice that uses two-way ssl. And I need to install the TLS certificate on my tomcat.

Tomcat version is 8.5.

TLS certificate is in .p12 format.

miyav miyav

Posted 2019-09-24T11:54:49.630

Reputation: 3

Answers

0

My reading of your question is that you have a web application running on Tomcat that needs to communicate over TLS, with certificate authentication, to an external service.

If the above summary is correct, this has nothing to do with Tomcat configuration. The client might be running on Tomcat but Tomcat has no role in the outbound TLS connection to the external service.

You code this in your application exactly the same way you would code a connection from a stand-alone Java application.

Mark Thomas

Posted 2019-09-24T11:54:49.630

Reputation: 136

It's nevermind now i fixed it adding -D flags to CATALINA_OPTS – miyav miyav – 2019-09-27T07:34:05.313

That is one way to fix it (assuming the client you are uses those system properties as defaults). However, be aware that this approach fails as soon as you need to make multiple connections with different credentials. – Mark Thomas – 2019-09-27T07:55:57.410

Cant you just add more certificates to trust/keystore? – miyav miyav – 2019-09-27T08:34:23.967

Not for mutual authentication. You need a way to tell the client which certificate it should use. You might get away with it if the client certs have different trust chains but it depends on how smart the client code is and the server config. Generally, I try and avoid global configuration via system properties wherever possible. – Mark Thomas – 2019-09-27T10:02:28.223