You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "cstamas (via GitHub)" <gi...@apache.org> on 2026/02/10 17:53:26 UTC

[PR] Minor bugfix: If proxy host cannot be resolved, fail [maven-resolver]

cstamas opened a new pull request, #1793:
URL: https://github.com/apache/maven-resolver/pull/1793

   As otherwise it goes unnoticed silently.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Minor bugfix: If proxy host cannot be resolved, fail [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas merged PR #1793:
URL: https://github.com/apache/maven-resolver/pull/1793


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Minor bugfix: If proxy host cannot be resolved, fail [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on code in PR #1793:
URL: https://github.com/apache/maven-resolver/pull/1793#discussion_r2790019976


##########
maven-resolver-transport-jdk-parent/maven-resolver-transport-jdk11/src/main/java/org/eclipse/aether/transport/jdk/JdkTransporter.java:
##########
@@ -545,10 +545,13 @@ public X509Certificate[] getAcceptedIssuers() {
                 HttpTransporterUtils.getHttpLocalAddress(session, repository).orElse(null));
 
         if (repository.getProxy() != null) {
-            ProxySelector proxy = ProxySelector.of(new InetSocketAddress(
-                    repository.getProxy().getHost(), repository.getProxy().getPort()));
-
-            builder.proxy(proxy);
+            InetSocketAddress proxyAddress = new InetSocketAddress(
+                    repository.getProxy().getHost(), repository.getProxy().getPort());
+            if (proxyAddress.isUnresolved()) {
+                throw new IllegalStateException(

Review Comment:
   Again, Resolver does not have any IT suite.
   
   I wholeheartedly agree with assessment, but am unsure we want to start creating IT suite now (just before releases) as it would delay things for quite some.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Minor bugfix: If proxy host cannot be resolved, fail [maven-resolver]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #1793:
URL: https://github.com/apache/maven-resolver/pull/1793#discussion_r2791734333


##########
maven-resolver-transport-jdk-parent/maven-resolver-transport-jdk11/src/main/java/org/eclipse/aether/transport/jdk/JdkTransporter.java:
##########
@@ -545,10 +545,13 @@ public X509Certificate[] getAcceptedIssuers() {
                 HttpTransporterUtils.getHttpLocalAddress(session, repository).orElse(null));
 
         if (repository.getProxy() != null) {
-            ProxySelector proxy = ProxySelector.of(new InetSocketAddress(
-                    repository.getProxy().getHost(), repository.getProxy().getPort()));
-
-            builder.proxy(proxy);
+            InetSocketAddress proxyAddress = new InetSocketAddress(
+                    repository.getProxy().getHost(), repository.getProxy().getPort());
+            if (proxyAddress.isUnresolved()) {
+                throw new IllegalStateException(

Review Comment:
   I was referring to the tests in https://github.com/apache/maven-resolver/blob/master/maven-resolver-test-http/src/main/java/org/eclipse/aether/internal/test/util/http/HttpTransporterTest.java (those are more IT than UT from my point of view). Should be easy to add a method which tests with an invalid proxy address, isn't it?



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Minor bugfix: If proxy host cannot be resolved, fail [maven-resolver]

Posted by "kwin (via GitHub)" <gi...@apache.org>.
kwin commented on code in PR #1793:
URL: https://github.com/apache/maven-resolver/pull/1793#discussion_r2790000633


##########
maven-resolver-transport-jdk-parent/maven-resolver-transport-jdk11/src/main/java/org/eclipse/aether/transport/jdk/JdkTransporter.java:
##########
@@ -545,10 +545,13 @@ public X509Certificate[] getAcceptedIssuers() {
                 HttpTransporterUtils.getHttpLocalAddress(session, repository).orElse(null));
 
         if (repository.getProxy() != null) {
-            ProxySelector proxy = ProxySelector.of(new InetSocketAddress(
-                    repository.getProxy().getHost(), repository.getProxy().getPort()));
-
-            builder.proxy(proxy);
+            InetSocketAddress proxyAddress = new InetSocketAddress(
+                    repository.getProxy().getHost(), repository.getProxy().getPort());
+            if (proxyAddress.isUnresolved()) {
+                throw new IllegalStateException(

Review Comment:
   Do the other transporters behave the same? If so we should have an IT, otherwise I would rather warn only instead of throwing an exception.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Minor bugfix: If proxy host cannot be resolved, fail [maven-resolver]

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #1793:
URL: https://github.com/apache/maven-resolver/pull/1793#issuecomment-3880983913

   I agree with @slawekjaranowski here: you set proxy either as you must or want. In both cases, fx with hostname typo, outcome is:
   * must => build will fail, fx central is reachable only via proxy
   * want => you could easily miss proxy being unused
   
   Note: same thing as with port: if host is resolved by port is wrong, you'd get immediate failure.


-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org