I have been trying to solve the problem and my solution is:

public class SecureSocketExample extends ExampleSupport {
...
public static void main(String[] args) {
    System.setProperty(SSLSocketBuilder.REMOTING_DEFAULT_SOCKET_FACTORY_CLASS,  
 "org.jboss.example.jms.common.MySSLSocketFactory");
    new SecureSocketExample().run();
}
}

public class MySSLSocketFactory {
        
        static {
                   HashMap<String, String> config = new HashMap<String, 
String>();
                   config.put(SSLSocketBuilder.REMOTING_KEY_STORE_FILE_PATH, 
"client.keystore");
                   config.put(SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD, 
"pssword");
                   config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_FILE_PATH, 
"client.truststore");
                   config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD, 
"password");
                   SSLSocketBuilder ssb = new SSLSocketBuilder(config);
                   ssb.setUseSSLSocketFactory(false);
                   try {
                        sf = ssb.createSSLSocketFactory(null);
                } catch (Exception e) {
                        e.printStackTrace();
                } 
    }
        
        private static SocketFactory sf;
        
        public static SocketFactory getDefault() {
                
                return sf;
        }
}



Now the runtime reads truststore, keystore info from the configuration map. I 
will try to fill the map from the resource file of the deploy war/jar/ear... So 
I can have more different queue clients talking to different "ssl" queues. 

If you have better solution, please suggest it.
Pavel Kadlec



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4089265#4089265

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4089265
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to