Проблемы с прокси на селене - PullRequest
0 голосов
/ 28 мая 2019

Я запускаю тесты на селен с использованием Java.Я настроил Google Chrome, используя следующий код:

  private void configureChromeOptions() {
    File file = new File(appParams.getDrivers().getChromeDriverPath());
    System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());

    chromeOptions = new ChromeOptions();
    chromeOptions.setBinary(appParams.getDrivers().getChromeBinariesPath());
    chromeOptions.addArguments("--start-maximized");
    chromeOptions.addArguments("--no-sandbox");
    chromeOptions.addArguments("--disable-setuid-sandbox");
    chromeOptions.addArguments("--ignore-certificate-errors");

    Map<String, Object> prefs = new HashMap<>();
    //Turns off multiple download warning
    prefs.put("profile.content_settings.pattern_pairs.*.multiple-automatic-downloads", Integer.valueOf(1));
    //Turns off download prompt
    prefs.put("download.prompt_for_download", Boolean.valueOf(false));
    prefs.put("profile.default_content_settings.popups", Integer.valueOf(0));
    prefs.put("download.default_directory", System.getProperty("user.home"));
    chromeOptions.setExperimentalOption("prefs", prefs);

    Proxy proxy = new Proxy();
    proxy.setHttpProxy(System.getProperty("http.proxyHost"));
    proxy.setSslProxy(System.getProperty("https.proxyHost"));
    logger.info("Configuring proxy with: ", System.getProperty("http.proxyHost"));

    chromeCapabilities = new DesiredCapabilities();
    chromeCapabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
  }

Но когда я пытаюсь получить доступ к веб-странице, я получаю следующую ошибку:

"This site can’t be reached www.mywebsite.com is currently unreachable. Try: Checking the connection Checking the proxy and the firewall ERR_SSL_VERSION_INTERFERENCE null Reload Details Check your Internet connection Check any cables and reboot any routers, modems, or other network devices you may be using. Allow Chrome to access the network in your firewall or antivirus settings. If it is already listed as a program allowed to access the network, try removing it from the list and adding it again. If you use a proxy server… Check your proxy settings or contact your network administrator to make sure the proxy server is working. If you don't believe you should be using a proxy server: Go to the Chrome menu > Settings > Show advanced settings… > Change proxy settings… and make sure your configuration is set to "no proxy" or "direct." www.mywebsite.com is currently unreachable."

Если я пытаюсь получить доступ к тому жеВеб-страница через curl, у меня нет проблем, если я использую ключи:

curl --proxy localhost:13128 -L -k --cert mycert.crt --key mycert.key -u username:password https://www.mywebsite.com

Это имеет доступ без проблем.Я использую cntlm для проверки подлинности прокси.Этот же код без проблем выполняется внутри образа докера.

Что может быть причиной этой проблемы с прокси?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...