rburgst/okhttp-digest

java.net.ProtocolException: Too many follow-up requests: 21

Closed this issue · 3 comments

Hi, I'm trying out your lib w/ latest Android SDK M and trying a http digest authentication web service returns me: java.net.ProtocolException: Too many follow-up requests: 21

I used your sample code:
OkHttpClient client = new OkHttpClient();
final DigestAuthenticator authenticator = new DigestAuthenticator(new Credentials(username, password));

        final Map<String, CachingAuthenticator> authCache = new ConcurrentHashMap<>();
        client.interceptors().add(new AuthenticationCacheInterceptor(authCache));
        client.setAuthenticator(new CachingAuthenticatorDecorator(authenticator, authCache));

        Request request = new Request.Builder()
                .url(url).get().build();
        Response response = client.newCall(request).execute();

Have you run into such an issue?

not yet, can you add the following code to your OkHttp client setup and see what it is doing?

    final HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor();
    httpLoggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
    client.networkInterceptors().add(httpLoggingInterceptor);

If you mask the authentication stuff, then you can also post it here, so I can have a look.

Seems like this might be caused by the lastest changes in okhttp-2.6.0. Need to investigate further.

this should be fixed in the latest version.