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 configuration #91

Open
damonho opened this issue Apr 23, 2024 · 2 comments
Open

Proxy configuration #91

damonho opened this issue Apr 23, 2024 · 2 comments

Comments

@damonho
Copy link

damonho commented Apr 23, 2024

Hi, I have to configure this library to use a proxy that requires authentication.

I see theres a previous issue opened about this #70, however the solution presented there don't quite work with auth.
From square/okhttp#4108, the okhttp library used doesn't respect java.net.Authenticator.setDefault, only java.net.ProxySelector.setDefault.

We have to set the authenticator in the client builder for it to be used.
https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.Builder.html#proxyAuthenticator-okhttp3.Authenticator-

Are we able to add a constructor for the AppStoreServerAPIClient that lets us pass in the OkHttpClient?

@alexanderjordanbaker
Copy link
Collaborator

@damonho Would configuring the OKHttpClient client's proxyAuthenticator to be Authenticator.JAVA_NET_AUTHENTICATOR be sufficient for your use case?

@damonho
Copy link
Author

damonho commented Apr 28, 2024

@alexanderjordanbaker That sounds like it should work as well for my use case 👍

alexanderjordanbaker added a commit to alexanderjordanbaker/app-store-server-library-java that referenced this issue May 4, 2024
If a default authenticator is used, it will be used for the proxy authentication

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

No branches or pull requests

2 participants