Author: ron.sigal(a)jboss.com
Date: 2008-02-29 03:24:27 -0500 (Fri, 29 Feb 2008)
New Revision: 3541
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslbisocket/SSLBisocketServerInvoker.java
Log:
JBREM-703: Added configuration for remaining ssl socket parameters.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslbisocket/SSLBisocketServerInvoker.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslbisocket/SSLBisocketServerInvoker.java 2008-02-29
08:23:54 UTC (rev 3540)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/transport/sslbisocket/SSLBisocketServerInvoker.java 2008-02-29
08:24:27 UTC (rev 3541)
@@ -31,8 +31,11 @@
import javax.net.ServerSocketFactory;
import javax.net.SocketFactory;
+import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.SocketException;
import java.util.Map;
/**
@@ -46,6 +49,10 @@
private static final Logger log = Logger.getLogger(SSLBisocketServerInvoker.class);
+ protected String[] enabledCipherSuites;
+ protected String[] enabledProtocols;
+ protected boolean enableSessionCreation = true;
+
public SSLBisocketServerInvoker(InvokerLocator locator)
{
super(locator);
@@ -60,7 +67,42 @@
{
return SSLServerSocketFactory.getDefault();
}
+
+ 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 ServerSocketFactory createServerSocketFactory() throws IOException
{
if (isCallbackServer)
@@ -72,6 +114,15 @@
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);
+
if (isCallbackServer)
{
socketFactory = createSocketFactory(configuration);
@@ -106,4 +157,23 @@
return sf;
}
+
+ 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