Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8259529

HTTP Proxy not properly detected using Java 15 on Windows 10

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10/ OpenJDK Java 15.0.1

      A DESCRIPTION OF THE PROBLEM :
      On Windows 10 I have an HTTP proxy set manually in the operating system. The Java 15 "ProxySelector.getDefault()" does not detect it on certain computers. This works consistently with java 1.8. Something probably changed in the "sun.net.spi.DefaultProxySelector" implementation.

      REGRESSION : Last worked in version 8

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Call in the code "ProxySelector.getDefault()" to detect the proxy, somehow on certain Windows 10 machines on our side the proxy is no longer detected.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The "ProxySelector.getDefault()" should detect the HTTP proxy set in the system.
      ACTUAL -
      The proxy configuration is not detected.

      ---------- BEGIN SOURCE ----------

        public static void main(String[] args) throws Exception {
          System.setProperty("java.net.useSystemProxies", "true");
          System.out.println("===============");
          System.out.println("ProxySelector " + ProxySelector.getDefault());
          List<Proxy> select = ProxySelector.getDefault().select(new URI("https://www.google.com/index.html"));
          System.out.println("System proxy: " + select);
          System.out.println("===============");
        }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Set a fixed proxy configuration from the Java code instead of relying on the auto detection.

      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              michaelm Michael McMahon
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: