jira-importer opened a new issue, #1513:
URL: https://github.com/apache/httpcomponents-core/issues/1513

   **[Isaac Cruz 
Ballesteros](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=icruz)**
 opened 
**[HTTPCORE-357](https://issues.apache.org/jira/browse/HTTPCORE-357?redirect=false)**
 and commented
   
   The class org.apache.http.nio.reactor.ssl.SSLIOSession is performing a DNS 
lookup in line 125:
   if (address instanceof InetSocketAddress) {
   String hostname = ((InetSocketAddress) address).getHostName();
   int port = ((InetSocketAddress) address).getPort();
   this.sslEngine = sslContext.createSSLEngine(hostname, port);
   } else {
   this.sslEngine = sslContext.createSSLEngine();
   }
   
   This lookup is not necessary to create the SSL engine (the method without 
parameters works the same), and it causes performance issues if the DNS server 
configured is not very fast. In my case, using a single thread, when receiving 
50 requests at the same time, the SSL handshake takes more than two minutes and 
the clients are timing out. Checking the java thread stack, the thread is 
always stuck on this lookup, waiting for the DNS server which sometimes takes 
around 4 seconds to answer.
   
   When not using SSL there's no lookup so everything works.
   
   If this lookup makes sense in some cases (I don't know much on SSL 
internals), maybe there should be an option to disable the lookup
   
   
   ---
   
   **Affects:** 4.3
   
   **Attachments:**
   - 
[HTTPCORE-357.patch](https://issues.apache.org/jira/secure/attachment/12615463/HTTPCORE-357.patch)
 (_3.18 kB_)
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to