[xmlsectool] branch main updated: JSSH-16: Update to Apache HttpClient 5.x

Brent Putman putmanb at georgetown.edu
Tue Feb 21 20:11:30 UTC 2023


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

putmanb pushed a commit to branch main
in repository xmlsectool.

View the commit online:
http://git.shibboleth.net/view/?p=xmlsectool.git;a=commit;h=fe939bb7a799ce20d98edb2c8e1ad7731a53ad63

The following commit(s) were added to refs/heads/main by this push:
     new fe939bb  JSSH-16: Update to Apache HttpClient 5.x
fe939bb is described below

commit fe939bb7a799ce20d98edb2c8e1ad7731a53ad63
Author: Brent Putman <putmanb at georgetown.edu>
AuthorDate: Tue Feb 21 15:10:22 2023 -0500

    JSSH-16: Update to Apache HttpClient 5.x
    
    Initial refactor.
---
 pom.xml                                                      |  6 +++---
 src/main/java/net/shibboleth/tool/xmlsectool/XMLSecTool.java | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/pom.xml b/pom.xml
index b06bc19..e1b60b7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,11 +93,11 @@
         </dependency>
         <dependency>
             <groupId>${httpclient.groupId}</groupId>
-            <artifactId>httpclient</artifactId>
+            <artifactId>${httpclient.artifactId}</artifactId>
         </dependency>
         <dependency>
-            <groupId>${httpclient.groupId}</groupId>
-            <artifactId>httpcore</artifactId>
+            <groupId>${httpclient.httpcore.groupId}</groupId>
+            <artifactId>${httpclient.httpcore.artifactId}</artifactId>
         </dependency>
         <dependency>
             <groupId>commons-codec</groupId>
diff --git a/src/main/java/net/shibboleth/tool/xmlsectool/XMLSecTool.java b/src/main/java/net/shibboleth/tool/xmlsectool/XMLSecTool.java
index c2acada..6f1a3d0 100644
--- a/src/main/java/net/shibboleth/tool/xmlsectool/XMLSecTool.java
+++ b/src/main/java/net/shibboleth/tool/xmlsectool/XMLSecTool.java
@@ -55,10 +55,10 @@ import javax.xml.transform.stream.StreamResult;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.codec.binary.Base64InputStream;
 import org.apache.commons.codec.binary.Base64OutputStream;
-import org.apache.http.Header;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
+import org.apache.hc.client5.http.classic.HttpClient;
+import org.apache.hc.client5.http.classic.methods.HttpGet;
+import org.apache.hc.core5.http.ClassicHttpResponse;
+import org.apache.hc.core5.http.Header;
 import org.apache.xml.security.exceptions.XMLSecurityException;
 import org.apache.xml.security.keys.KeyInfo;
 import org.apache.xml.security.keys.content.KeyName;
@@ -263,8 +263,8 @@ public final class XMLSecTool {
         getMethod.setHeader("Accept-Encoding", "gzip,deflate");
         try {
             final HttpClient httpClient = httpClientBuilder.buildClient();
-            final HttpResponse response = httpClient.execute(getMethod);
-            final int status = response.getStatusLine().getStatusCode();
+            final ClassicHttpResponse response = httpClient.executeOpen(null, getMethod, null);
+            final int status = response.getCode();
             if (status != 200) {
                 log.error("Non-ok status code '" + Integer.valueOf(status) + "' returned by '"
                         + cli.getInputUrl() + "'");

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


More information about the commits mailing list