Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy with authentcation is not accepted #1872

Open
OndraM opened this issue Apr 14, 2021 · 1 comment
Open

Proxy with authentcation is not accepted #1872

OndraM opened this issue Apr 14, 2021 · 1 comment

Comments

@OndraM
Copy link
Contributor

OndraM commented Apr 14, 2021

System

  • Version: 0.29.1
  • Platform: arch linux 64
  • Firefox: 87.0
  • Selenium: php-webdriver

Testcase

I initialize session from php-webdriver, but I believe the issue does not depend on the language bindings used. So here they are just for reference and as an example.

<?php

use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\WebDriverBrowserType;
use Facebook\WebDriver\Remote\WebDriverCapabilityType;

require_once('vendor/autoload.php');

$capabilities = new DesiredCapabilities(
    [
        'browserName' => 'firefox',
        'proxy' => [
            'proxyType' => 'manual',
            'httpProxy' => 'user:pass@localhost:8080',
            'sslProxy' => 'user:pass@localhost:8080',
        ]
    ]
);
$driver = RemoteWebDriver::create('http://localhost:4444', $capabilities);
$driver->get('https://google.com/');

According to W3C WebDriver specification, this form is a proper way how to pass proxy credentials.

Stacktrace

Output of geckodriver --log debug when script above is executed:

$ geckodriver --log debug
1618399457852   geckodriver     INFO    Listening on 127.0.0.1:4444
1618399458972   webdriver::server       DEBUG   -> POST /session {"capabilities":{"firstMatch":[{"browserName":"firefox","proxy":{"proxyType":"manual","httpProxy":"user:pass@localhost:8080","sslProxy":"user:pass@localhost:8080"}}]}}
1618399458972   webdriver::server       DEBUG   <- 400 Bad Request {"value":{"error":"invalid argument","message":"httpProxy is not of the form host[:port]: user:pass@localhost:8080","stacktrace":""}}

From the error httpProxy is not of the form host[:port] it seems geckodriver does not accept the W3C WebDriver form according to the specification.

@whimboo
Copy link
Collaborator

whimboo commented Apr 14, 2021

A proxy with authentication is not supported yet. The required work is tracked via https://bugzilla.mozilla.org/show_bug.cgi?id=1395886.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants