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

CBL-5213: Proxy auth #236

Merged
merged 2 commits into from
Dec 8, 2023
Merged

CBL-5213: Proxy auth #236

merged 2 commits into from
Dec 8, 2023

Conversation

bmeike
Copy link
Contributor

@bmeike bmeike commented Dec 6, 2023

Tests for CBL-5201, CBL-5207, CBL-5213

@bmeike bmeike requested a review from pasin December 6, 2023 01:36
@bmeike bmeike requested a review from borrrden December 6, 2023 16:31

builder.authenticator((route, resp) -> authenticate(resp, credentials));
if ((proxyCredentials != null) || (endpointCredentials != null)) {
builder.authenticator((route, resp) -> authenticate(resp, endptCred, proxyCred));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or is this for the preemptive authenticator which handles both endpoint and proxy auth?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following this code sample, from the OkHttp 3.14 (the version we use) docs:
https://square.github.io/okhttp/3.x/okhttp/okhttp3/Authenticator.html

As I understand it, I will get this callback, preemptively, so that OkHttp has the credentials before it tries to connect.
I could be mistaken.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I think it could be a good idea if we do a manual test at least once to confirm that all are correct including the OkHttp-Preemptive challenge name.

@bmeike bmeike requested a review from pasin December 7, 2023 16:45

builder.authenticator((route, resp) -> authenticate(resp, credentials));
if ((proxyCredentials != null) || (endpointCredentials != null)) {
builder.authenticator((route, resp) -> authenticate(resp, endptCred, proxyCred));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I think it could be a good idea if we do a manual test at least once to confirm that all are correct including the OkHttp-Preemptive challenge name.

@bmeike bmeike merged commit eda213e into master Dec 8, 2023
@bmeike bmeike deleted the pr/CBL-5213 branch December 8, 2023 18:07
@bmeike
Copy link
Contributor Author

bmeike commented Dec 8, 2023

I totally agree. We need to see how this works in the real world, on a couple versions of Android.

It is going to be quite hard to set up the test, though. Perhaps with Charles....

@pasin
Copy link
Contributor

pasin commented Dec 8, 2023

I used https://mitmproxy.org before and there was a customer using http:https://www.squid-cache.org.

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