Trying to do the same thing. I can't understand what other people are doing to get
around this problem. We have multiple keystores, so i have to override the default
behavior for the SSLContext...
This is what i need to do, but i can't figure out how/when to call this to set the
socket factory.
| KeyStore ts = KeyStore.getInstance("JKS");
| ts.load(new FileInputStream(trustStoreFullName), trustStorePassword.toCharArray());
| TrustManager[] tm;
| TrustManagerFactory tmf =
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
| tmf.init(ts);
| tm = tmf.getTrustManagers();
|
| SSLContext sslContext = SSLContext.getInstance("SSL");
| sslContext.init(kmf.getKeyManagers(), tm, null);
|
| SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
|
| HttpsURLConnection urlc = (HttpsURLConnection) url.openConnection();
| urlc.setSSLSocketFactory(sslSocketFactory);
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184514#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...