Author: ron.sigal(a)jboss.com
Date: 2008-04-02 00:02:50 -0400 (Wed, 02 Apr 2008)
New Revision: 3839
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/security/CustomSSLServerSocketFactory.java
Log:
JBREM-934: Put MBean proxy calls in AccessController.doPrivileged() calls.
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/security/CustomSSLServerSocketFactory.java
===================================================================
---
remoting2/branches/2.x/src/main/org/jboss/remoting/security/CustomSSLServerSocketFactory.java 2008-04-02
03:58:55 UTC (rev 3838)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/security/CustomSSLServerSocketFactory.java 2008-04-02
04:02:50 UTC (rev 3839)
@@ -3,12 +3,15 @@
*/
package org.jboss.remoting.security;
-import javax.net.ssl.SSLServerSocket;
-import javax.net.ssl.SSLServerSocketFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import javax.net.ssl.SSLServerSocket;
+import javax.net.ssl.SSLServerSocketFactory;
+
/**
* SSL server socket factory whose configuration is customized.
*
@@ -174,14 +177,39 @@
{
if ( theBuilder != null )
{
- sock.setUseClientMode( theBuilder.isServerSocketUseClientMode() );
+
+ boolean isServerSocketUseClientMode = ((Boolean)AccessController.doPrivileged(
new PrivilegedAction()
+ {
+ public Object run()
+ {
+ return new Boolean(theBuilder.isServerSocketUseClientMode());
+ }
+ })).booleanValue();
+
+ boolean isClientAuthModeWant = ((Boolean)AccessController.doPrivileged( new
PrivilegedAction()
+ {
+ public Object run()
+ {
+ return new Boolean(theBuilder.isClientAuthModeWant());
+ }
+ })).booleanValue();
+
+ boolean isClientAuthModeNeed = ((Boolean)AccessController.doPrivileged( new
PrivilegedAction()
+ {
+ public Object run()
+ {
+ return new Boolean(theBuilder.isClientAuthModeNeed());
+ }
+ })).booleanValue();
- if ( theBuilder.isClientAuthModeWant() )
+ sock.setUseClientMode( isServerSocketUseClientMode );
+
+ if ( isClientAuthModeWant )
{
sock.setNeedClientAuth( false );
sock.setWantClientAuth( true );
}
- else if ( theBuilder.isClientAuthModeNeed() )
+ else if ( isClientAuthModeNeed )
{
sock.setWantClientAuth( false );
sock.setNeedClientAuth( true );
Show replies by date