Author: ron.sigal(a)jboss.com
Date: 2008-02-29 03:25:33 -0500 (Fri, 29 Feb 2008)
New Revision: 3543
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket/SSLSocketServerInvoker.java
Log:
JBREM-703: Added configuration for remaining ssl socket parameters.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket/SSLSocketServerInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket/SSLSocketServerInvoker.java 2008-02-29
08:24:59 UTC (rev 3542)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslsocket/SSLSocketServerInvoker.java 2008-02-29
08:25:33 UTC (rev 3543)
@@ -22,11 +22,15 @@
package org.jboss.remoting.transport.sslsocket;
+import org.jboss.logging.Logger;
import org.jboss.remoting.InvokerLocator;
import org.jboss.remoting.transport.socket.SocketServerInvoker;
-
import javax.net.ServerSocketFactory;
+import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
+
+import java.net.ServerSocket;
+import java.net.SocketException;
import java.util.Map;
/**
@@ -34,7 +38,12 @@
*/
public class SSLSocketServerInvoker extends SocketServerInvoker implements
SSLSocketServerInvokerMBean
{
+ private static final Logger log = Logger.getLogger(SSLSocketServerInvoker.class);
+ protected String[] enabledCipherSuites;
+ protected String[] enabledProtocols;
+ protected boolean enableSessionCreation = true;
+
public SSLSocketServerInvoker(InvokerLocator locator)
{
super(locator);
@@ -45,9 +54,75 @@
super(locator, configuration);
}
+ public void setOOBInline(boolean inline)
+ {
+ log.warn("Ignored: sending urgent data is not supported by SSLSockets");
+ }
+
+ public String[] getEnabledCipherSuites()
+ {
+ return enabledCipherSuites;
+ }
+
+ public void setEnabledCipherSuites(String[] enabledCipherSuites)
+ {
+ this.enabledCipherSuites = enabledCipherSuites;
+ }
+
+ public String[] getEnabledProtocols()
+ {
+ return enabledProtocols;
+ }
+
+ public void setEnabledProtocols(String[] enabledProtocols)
+ {
+ this.enabledProtocols = enabledProtocols;
+ }
+
+ public boolean isEnableSessionCreation()
+ {
+ return enableSessionCreation;
+ }
+
+ public void setEnableSessionCreation(boolean enableSessionCreation)
+ {
+ this.enableSessionCreation = enableSessionCreation;
+ }
+
+ protected void setup() throws Exception
+ {
+ super.setup();
+
+ Object o = configuration.get("enabledCipherSuites");
+ if (o instanceof String[])
+ setEnabledCipherSuites((String[]) o);
+
+ o = configuration.get("enabledProtocols");
+ if (o instanceof String[])
+ setEnabledProtocols((String[]) o);
+ }
+
protected ServerSocketFactory getDefaultServerSocketFactory()
{
return SSLServerSocketFactory.getDefault();
}
+ protected void configureServerSocket(ServerSocket ss) throws SocketException
+ {
+ super.configureServerSocket(ss);
+
+ if (ss instanceof SSLServerSocket)
+ {
+ SSLServerSocket sss = (SSLServerSocket) ss;
+ if (enabledCipherSuites != null)
+ {
+ sss.setEnabledCipherSuites(enabledCipherSuites);
+ }
+ if (enabledProtocols != null)
+ {
+ sss.setEnabledProtocols(enabledProtocols);
+ }
+ sss.setEnableSessionCreation(enableSessionCreation);
+ }
+ }
}
\ No newline at end of file
Show replies by date