Author: ron.sigal(a)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);
Show replies by date