Skip to content

Commit ea5c470

Browse files
Add proxyAuthenticator set to JAVA_NET_AUTHENTICATOR
If a default authenticator is used, it will be used for the proxy authentication #91
1 parent 084f4f2 commit ea5c470

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/com/apple/itunes/storekit/client/AppStoreServerAPIClient.java

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.fasterxml.jackson.annotation.JsonAutoDetect;
2525
import com.fasterxml.jackson.core.JsonProcessingException;
2626
import com.fasterxml.jackson.databind.ObjectMapper;
27+
import okhttp3.Authenticator;
2728
import okhttp3.Call;
2829
import okhttp3.HttpUrl;
2930
import okhttp3.MediaType;
@@ -64,6 +65,8 @@ public class AppStoreServerAPIClient {
6465
public AppStoreServerAPIClient(String signingKey, String keyId, String issuerId, String bundleId, Environment environment) {
6566
this.bearerTokenAuthenticator = new BearerTokenAuthenticator(signingKey, keyId, issuerId, bundleId);
6667
OkHttpClient.Builder builder = new OkHttpClient.Builder();
68+
// If a proxy is configured via java.net.ProxySelector.setDefault, this will allow java.net.Authenticator.setDefault to serve as its auth source
69+
builder.proxyAuthenticator(Authenticator.JAVA_NET_AUTHENTICATOR);
6770
this.httpClient = builder.build();
6871
switch (environment) {
6972
case XCODE:

0 commit comments

Comments
 (0)