[java-identity-provider] branch maint-3.4 updated: IDP-1658: httpclient sockets stuck in CLOSE_WAIT break CAS proxy ...

Brent Putman putmanb at georgetown.edu
Fri Aug 21 16:52:45 UTC 2020


This is an automated email from the git hooks/post-receive script.

putmanb pushed a commit to branch maint-3.4
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=b098b4dbed8b5a544880b0959f03ed3a9f866ebc

The following commit(s) were added to refs/heads/maint-3.4 by this push:
       new  b098b4dbe IDP-1658: httpclient sockets stuck in CLOSE_WAIT break CAS proxy ...
b098b4dbe is described below

commit b098b4dbed8b5a544880b0959f03ed3a9f866ebc
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Fri Aug 21 12:52:43 2020 -0400

    IDP-1658: httpclient sockets stuck in CLOSE_WAIT break CAS proxy ...
    
    httpclient sockets stuck in CLOSE_WAIT break CAS proxy callback
---
 .../idp/cas/proxy/impl/HttpClientProxyValidator.java          | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
index 83b01ba22..73e6f8dd2 100644
--- a/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
+++ b/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/proxy/impl/HttpClientProxyValidator.java
@@ -46,6 +46,7 @@ import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.HttpClient;
+import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.protocol.HttpClientContext;
 import org.opensaml.core.criterion.EntityIdCriterion;
@@ -155,7 +156,7 @@ public class HttpClientProxyValidator implements ProxyValidator {
         final HttpClientContext clientContext = HttpClientContext.create();
         HttpClientSecuritySupport.marshalSecurityParameters(clientContext, securityParameters, true);
         setCASTLSTrustEngineCriteria(clientContext, uri, service);
-        HttpResponse response;
+        HttpResponse response = null;
         try {
             log.debug("Attempting to validate CAS proxy callback URI {}", uri);
             final HttpGet request = new HttpGet(uri);
@@ -173,6 +174,14 @@ public class HttpClientProxyValidator implements ProxyValidator {
             throw new GeneralSecurityException("SSL connection error", e);
         } catch (final IOException e) {
             throw new GeneralSecurityException("IO error", e);
+        } finally {
+            if (response != null && CloseableHttpResponse.class.isInstance(response)) {
+                try {
+                    CloseableHttpResponse.class.cast(response).close();
+                } catch (IOException e) {
+                    log.debug("Error closing HttpResponse", e);
+                }
+            }
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list