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

io.testerra.bup - forward username and password for proxy with username and password #140

Closed
jdoeschn opened this issue Oct 25, 2021 · 5 comments · Fixed by #149
Closed
Labels
enhancement New feature or request

Comments

@jdoeschn
Copy link

Problem description
I have to run testerra tests through an https proxy (so the system under test is behind this proxy). The proxy need s username and password for authentication. I need to provide username and password to the https proxy before accessing the SUT.

*Prefered solution
On proxy setup, it should be possible to add credentials (username and passwort) for authentication against web proxies.

Describe alternatives you've considered
I could setup browsermobproxy without testerra, but testerra already has a bup integration - so i'd prefere using it.

Additional context
no additional context.

Maybe it is enough to set in startServer method the parameters (if provided)
startServerUriBuilder.setParameter("proxyUsername", username);
startServerUriBuilder.setParameter("proxyPassword", password);
and add a way to set username and password

@jdoeschn jdoeschn added the enhancement New feature or request label Oct 25, 2021
@mreiche
Copy link
Collaborator

mreiche commented Oct 26, 2021

Isn't it possible to pass credentials in the constructor URL?

URL apiBaseUrl = new URL("https://user:password@my-proxy");
BrowserUpRemoteProxyManager browserUpRemoteProxyManager = new BrowserUpRemoteProxyManager(apiBaseUrl);

@martingrossmann
Copy link
Contributor

I think, @jdoeschn means the upstream proxy which requires username/pass. But Mikes solution could also work for them:

BrowserUpRemoteProxyServer bup1 = new BrowserUpRemoteProxyServer();
bup1.setUpstreamProxy(apiBaseUrl);

@JanDoeschner
Copy link

@martingrossmann : yes, sorry for my incomplete problem description, I mean the upstream proxy.

I am currently using
bupProxy.setUpstreamProxy(ProxyUtils.getSystemHttpProxyUrl());
ProxyUtils uses https (or http - depending on given protocol) .proxyUser and .proxyPassword if configures (which are configured in my case in the system.properties)
so it creates internally the user:password@...-URL

@mreiche
Copy link
Collaborator

mreiche commented Oct 28, 2021

What kind of authentication is used for the upstream proxy? Is it generally possible to access the proxy via. credentials in the URL?

@mreiche mreiche mentioned this issue Nov 4, 2021
9 tasks
@JanDoeschner
Copy link

Thank you for the fast support! The bugfix solved my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants