private ProxyChallengeProcessor getChallengeProcessor()

in src/main/java/com/microsoft/azure/proton/transport/proxy/impl/ProxyImpl.java [498:518]


        private ProxyChallengeProcessor getChallengeProcessor(String host, List<String> challenges,
                                                              ProxyAuthenticationType authentication) {
            final ProxyAuthenticator authenticator = proxyConfiguration != null
                    ? new ProxyAuthenticator(proxyConfiguration)
                    : new ProxyAuthenticator();

            switch (authentication) {
                case DIGEST:
                    final Optional<String> matching = challenges.stream()
                            .filter(challenge -> challenge.toLowerCase(Locale.ROOT).startsWith(Constants.DIGEST_LOWERCASE))
                            .findFirst();

                    return matching.map(c -> new DigestProxyChallengeProcessorImpl(host, c, authenticator))
                            .orElse(null);
                case BASIC:
                    return new BasicProxyChallengeProcessorImpl(host, authenticator);
                default:
                    LOGGER.warn("Authentication type does not have a challenge processor: {}", authentication);
                    return null;
            }
        }