Skip to content

[🐛 Bug]: Selenium 4 Java does not support authenticated proxy to connect to remote webdriver #10231

@girtsn

Description

@girtsn

What happened?

Hello, using Selenium 4.1.1 from Java - our setup has a corporate authenticated proxy needed to get to a Selenium grid connection

How can we reproduce the issue?

The documented ways to do authentication with Proxy, e.g. setting system properties or Authenticator handler like below, works in the sense that it tries to use the proxy, but does not perform the authentication. Doing the same for an http connection works so must be specific to http connection implementation. netty has ProxyHandler and an authentication scheme (https://netty.io/4.1/api/io/netty/handler/proxy/ProxyHandler.html) but not sure how to apply it when setting up the remote driver

        System.getProperties().put("http.proxyHost", proxyHost);
        System.getProperties().put("http.proxyPort", proxyPort);
        System.getProperties().put("http.proxyUser", proxyUser);
        System.getProperties().put("http.proxyPassword", proxyPassword);

        System.getProperties().put("https.proxyHost", proxyHost);
        System.getProperties().put("https.proxyPort", proxyPort);
        System.getProperties().put("https.proxyUser", proxyUser);
        System.getProperties().put("https.proxyPassword", proxyPassword);

        Authenticator.setDefault(new Authenticator() {
            public PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(proxyUser, proxyPassword.toCharArray());
            }
        } );

        WebDriver driver = new RemoteWebDriver(new URL("http://10.0.0.1/wd/hub"), options);

Relevant log output

no log output

Operating System

Windows 10

Selenium version

Java 4.1.1

What are the browser(s) and version(s) where you see this issue?

Chrome 96

What are the browser driver(s) and version(s) where you see this issue?

Remote

Are you using Selenium Grid?

4.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaJava BindingsI-defectSomething is not working as intendedJ-awaiting answerQuestion asked of user; a reply moves it to triage again

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions