For starters, i have my Tomcat8 configured for https with valid certificated linked in connector xml file.
Something like this:
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
SSLEnabled="true" maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" enableLookups="false" keyAlias="https"
keystoreFile="C:\Program Files\Apache Software Foundation\Tomcat 8.0\conf\keystore.jks"
keystorePass="changeit"/>
But I need my web aplication to connect as client to third party data provider with valid certificate. Where do i put this extra certificate? When I put in keystore for connector, "https" certificate is not first certificate and it breaks stuff. I can probably fix that with keyAlias
atribute in connector...
But... Are the connector keystores application wide? What is the best option for this kind of setup?
This article pretty much sums up my options, which one to pick? Best option seems to be pass keystore with both certificates to JVM, but how to tell connector which certificate to use?
EDIT:
After suggestion I edited my connector and keystore like this:
Now I am getting:
Wrapped javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException:
PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
Cause: sun.security.validator.ValidatorException: PKIX path building
failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target]