ok2c commented on a change in pull request #138: Execute 
Socket[Channel]#connect under doPrivileged
URL: 
https://github.com/apache/httpcomponents-core/pull/138#discussion_r314220384
 
 

 ##########
 File path: 
httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java
 ##########
 @@ -177,7 +181,24 @@ public HttpClientConnection create(final HttpHost host) 
throws IOException {
             socket.setSoLinger(true, linger);
         }
         socket.setKeepAlive(this.sconfig.isSoKeepAlive());
-        socket.connect(new InetSocketAddress(hostname, port), 
this.connectTimeout);
+        // Run this under a doPrivileged to support lib users that run under a 
SecurityManager this allows granting connect permissions
+        // only to this library
+        final Socket finalSocket = socket;
 
 Review comment:
   @s1monw Can we eliminate `finalSocket`? It is no longer required.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to