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 credentials don´t work within browser #21

Open
ZNicoZ opened this issue Dec 17, 2019 · 7 comments
Open

Proxy credentials don´t work within browser #21

ZNicoZ opened this issue Dec 17, 2019 · 7 comments
Labels
blocked by 3rd party on Hold Requires clarification

Comments

@ZNicoZ
Copy link
Member

ZNicoZ commented Dec 17, 2019

A proxy with credentials won´t be transmitted to the browser (chrome)

HTTP_PROXY=http://username:[email protected]

WGET within the container was able to resolve the proxy.

Workaround at a customer was to use another proxy which authenticates against the actual proxy but was used by sakuli.

@svettwer svettwer added the on Hold Requires clarification label Dec 20, 2019
@svettwer svettwer self-assigned this Jan 2, 2020
@svettwer
Copy link
Contributor

svettwer commented Aug 3, 2020

The issue is caused by an inconsistent proxy handling in Sakuli. Provided environment variables are not considered during test case execution, as Selenium requires a specific proxy config when creating the webdriver.

E.g:

selenium.proxy.proxyType=manual
selenium.proxy.httpProxy="http://foobar:[email protected]:3128"
selenium.proxy.sslProxy="https://foobar:[email protected]:3128"

Workaround
A workaround would be to configure the proxy twice. Once as container environment variables and once as properties in sakuli.properties

Possible solutions

  1. Check HTTP(S)_PROXY environment variables when creating the driver and overwrite whatever comes from sakuli.properties
  2. During container startup : echo "selenium.proxy.httpProxy=${HTTP_PROXY}" >> ${SAKULI_EXECUTION_DIR}/sakuli.properties

I'd prefer the first solution as it would be a consistent convention not only in the container but also on test hosts.

@svettwer svettwer removed the on Hold Requires clarification label Aug 3, 2020
@svettwer svettwer removed their assignment Aug 3, 2020
@svettwer
Copy link
Contributor

svettwer commented Aug 3, 2020

For development and testing, I recommend https://github.com/svettwer/dev-proxy

@svettwer
Copy link
Contributor

We agreed to go with attempt No. 1

@svettwer
Copy link
Contributor

Summary of the last two hours:

  1. The workaround was just working by accident. For some reason, the proxy is not used at all if credentials are provided in the config. They are passed to selenium but seems to be discarded afterwards.
  2. Selenium seems to be unable to process proxy credentials without additional plugins.

@svettwer
Copy link
Contributor

svettwer commented Aug 25, 2020

Todo: Find a way so that selenium uses proxy credentials.

Open upstream issues:

@svettwer svettwer added the on Hold Requires clarification label Aug 25, 2020
@svettwer
Copy link
Contributor

svettwer commented Aug 25, 2020

Sakuli Workaround:

selenium.proxy.proxyType=manual
selenium.proxy.httpProxy=127.0.0.1:3128
selenium.proxy.sslProxy=127.0.0.1:3128
  • Insert creds with native ui interaction

@svettwer
Copy link
Contributor

Workaround available; fix not possible => 🧊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by 3rd party on Hold Requires clarification
Projects
None yet
Development

No branches or pull requests

5 participants