andrevka commented on a change in pull request #307: URL: https://github.com/apache/james-project/pull/307#discussion_r582694019
########## File path: backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java ########## @@ -18,18 +18,278 @@ ****************************************************************/ package org.apache.james.backends.rabbitmq; +import java.io.File; import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Paths; import java.util.Arrays; import java.util.Objects; import java.util.Optional; +import java.util.stream.Stream; import org.apache.commons.configuration2.Configuration; import com.google.common.base.Preconditions; import com.google.common.base.Strings; +import static org.apache.james.backends.rabbitmq.RabbitMQConfiguration.SSLConfiguration.*; +import static org.apache.james.backends.rabbitmq.RabbitMQConfiguration.SSLConfiguration.SSLValidationStrategy.*; + public class RabbitMQConfiguration { + public static class SSLConfiguration { + + public enum SSLValidationStrategy { + DEFAULT, + IGNORE, + OVERRIDE; + + static SSLValidationStrategy from(String rawValue) { + Preconditions.checkNotNull(rawValue); + + return Stream.of(values()) + .filter(strategy -> strategy.name().equalsIgnoreCase(rawValue)) + .findAny() + .orElseThrow(() -> new IllegalArgumentException(String.format("invalid strategy '%s'", rawValue))); + + } + } + + public enum HostNameVerifier { + DEFAULT, Review comment: what do you think of SUBJECT_ALTERNATIVE_NAME_VERIFIER ? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org