[jboss-remoting-commits] JBoss Remoting SVN: r6458 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/ssl.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Thu Jul 19 17:35:10 EDT 2012


Author: ron.sigal at jboss.com
Date: 2012-07-19 17:35:09 -0400 (Thu, 19 Jul 2012)
New Revision: 6458

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/ssl/HTTPSClientInvoker.java
Log:
JBREM-1306: Wrapped HttpsURLConnection.setSSLSocketFactory in a doPrivileged() call.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/ssl/HTTPSClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/ssl/HTTPSClientInvoker.java	2012-07-19 02:44:29 UTC (rev 6457)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/http/ssl/HTTPSClientInvoker.java	2012-07-19 21:35:09 UTC (rev 6458)
@@ -24,6 +24,7 @@
 
 import org.jboss.remoting.Client;
 import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.InvokerRegistry;
 import org.jboss.remoting.serialization.ClassLoaderUtility;
 import org.jboss.remoting.security.CustomSSLSocketFactory;
 import org.jboss.remoting.security.SSLSocketBuilder;
@@ -97,13 +98,22 @@
 
       if (conn instanceof HttpsURLConnection)
       {
-         HttpsURLConnection sconn = (HttpsURLConnection) conn;
+         final HttpsURLConnection sconn = (HttpsURLConnection) conn;
 
          SocketFactory socketFactory = getSocketFactory();
          if (socketFactory != null && socketFactory instanceof SSLSocketFactory)
          {
-            SSLSocketFactory sslSocketFactory = getHandshakeCompatibleFactory((SSLSocketFactory) socketFactory, metadata);
-            sconn.setSSLSocketFactory(sslSocketFactory);
+            final SSLSocketFactory sslSocketFactory = getHandshakeCompatibleFactory((SSLSocketFactory) socketFactory, metadata);
+            
+            AccessController.doPrivileged( new PrivilegedAction()
+            {
+               public Object run()
+               {
+                  sconn.setSSLSocketFactory(sslSocketFactory);
+                  return null;
+               }
+            });
+            
          }
 
          setHostnameVerifier(sconn, metadata);



More information about the jboss-remoting-commits mailing list