This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch maven-resolver-1.9.x
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git


The following commit(s) were added to refs/heads/maven-resolver-1.9.x by this 
push:
     new ce051b44 Rollback #747 with comments (#1510)
ce051b44 is described below

commit ce051b4443fbd47476fbfb3d790f711f1dc526ea
Author: Tamas Cservenak <[email protected]>
AuthorDate: Thu Jun 26 15:11:00 2025 +0200

    Rollback #747 with comments (#1510)
    
    Also the added UTs made no sense from retrospective, as they used HTTP 
remote repo with HTTPS proxy, something Maven would never do.
    
    Rolls back #747 but leaves traces and some context.
    Ref https://github.com/apache/maven/issues/2519
---
 .../aether/transport/http/HttpTransporter.java     |  6 +++-
 .../aether/transport/http/HttpTransporterTest.java | 36 ----------------------
 2 files changed, 5 insertions(+), 37 deletions(-)

diff --git 
a/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java
 
b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java
index 6d6fa588..4c60d3b8 100644
--- 
a/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java
+++ 
b/maven-resolver-transport-http/src/main/java/org/eclipse/aether/transport/http/HttpTransporter.java
@@ -382,7 +382,11 @@ final class HttpTransporter extends AbstractTransporter {
     private static HttpHost toHost(Proxy proxy) {
         HttpHost host = null;
         if (proxy != null) {
-            host = new HttpHost(proxy.getHost(), proxy.getPort(), 
proxy.getType());
+            // in Maven, the proxy.protocol is used for proxy matching against 
remote repository protocol; no TLS proxy
+            // support
+            // https://github.com/apache/maven/issues/2519
+            // https://github.com/apache/maven-resolver/issues/745
+            host = new HttpHost(proxy.getHost(), proxy.getPort());
         }
         return host;
     }
diff --git 
a/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java
 
b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java
index f04d672a..322f7a89 100644
--- 
a/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java
+++ 
b/maven-resolver-transport-http/src/test/java/org/eclipse/aether/transport/http/HttpTransporterTest.java
@@ -391,27 +391,6 @@ public class HttpTransporterTest {
         assertEquals(task.getDataString(), new 
String(listener.baos.toByteArray(), StandardCharsets.UTF_8));
     }
 
-    @Test
-    public void testGetProxyAuthenticatedHttps() throws Exception {
-        httpServer.addSslConnector();
-        httpServer.setProxyAuthentication("testuser", "testpass");
-        Authentication auth = new AuthenticationBuilder()
-                .addUsername("testuser")
-                .addPassword("testpass")
-                .build();
-        proxy = new Proxy(Proxy.TYPE_HTTPS, httpServer.getHost(), 
httpServer.getHttpsPort(), auth);
-        newTransporter("http://bad.localhost:1/";);
-        RecordingTransportListener listener = new RecordingTransportListener();
-        GetTask task = new 
GetTask(URI.create("repo/file.txt")).setListener(listener);
-        transporter.get(task);
-        assertEquals("test", task.getDataString());
-        assertEquals(0L, listener.dataOffset);
-        assertEquals(4L, listener.dataLength);
-        assertEquals(1, listener.startedCount);
-        assertTrue("Count: " + listener.progressedCount, 
listener.progressedCount > 0);
-        assertEquals(task.getDataString(), new 
String(listener.baos.toByteArray(), StandardCharsets.UTF_8));
-    }
-
     @Test
     public void testGetProxyUnauthenticated() throws Exception {
         httpServer.setProxyAuthentication("testuser", "testpass");
@@ -1159,21 +1138,6 @@ public class HttpTransporterTest {
         }
     }
 
-    @Test
-    public void testProxyType() throws Exception {
-        httpServer.addSslConnector();
-        proxy = new Proxy(Proxy.TYPE_HTTPS, httpServer.getHost(), 
httpServer.getHttpsPort(), null);
-        newTransporter("http://bad.localhost:1/";);
-        try {
-            transporter.get(new GetTask(URI.create("foo/file.txt")));
-        } catch (HttpResponseException e) {
-            assertEquals(404, e.getStatusCode());
-            assertEquals(
-                    "http://bad.localhost:1/foo/file.txt";,
-                    httpServer.getLogEntries().get(0).path);
-        }
-    }
-
     @Test
     public void testAuthSchemeReuse() throws Exception {
         httpServer.setAuthentication("testuser", "testpass");

Reply via email to