Hi,
I have a webapp that calls an admin service of IS through mutual ssl
authentication. The call is done using the HttpClient. For that I am
setting the keystore and truststore details of the client at runtime like
below.
System.setProperty("javax.net.ssl.keyStore",
CLIENT_KEY_STORE_PATH);
System.setProperty("javax.net.ssl.trustStore",
CLIENT_TRUST_STORE_PATH);
System.setProperty("javax.net.ssl.keyStorePassword",
CLIENT_KEY_STORE_PASSWORD);
System.setProperty("javax.net.ssl.trustStorePassword",
CLIENT_TRUST_STORE_PASSWORD);
SSLContext context = SSLContexts.createSystemDefault();
HttpClientBuilder builder = HttpClientBuilder.create();
Registry<ConnectionSocketFactory> registry = RegistryBuilder
.<ConnectionSocketFactory>create()
.register("https", new
SSLConnectionSocketFactory(context))
.build();
HttpClientConnectionManager ccm = new
BasicHttpClientConnectionManager(registry);
builder.setConnectionManager(ccm);
HttpClient client = builder.build();
Now I want to get rid of the code that sets the ssl system properties at
runtime. Here it is assumed that those properties are already set.
But System.getProperty("javax.net.ssl.keyStore") and
System.getProperty("javax.net.ssl.keyStorePassword") return null at runtime
and therefore the client cannot call the service properly.
It seems those two properties get overwritten at runtime. TrustStore
properties are not overwritten and they remain with the same values set
previously.
Any suggestions for setting the keyStore properties correctly (outside the
webapp) ?
--
Tharindu Edirisinghe
Software Engineer | WSO2 Inc
Identity Server Team
mobile : +94 775 181586
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev