szetszwo commented on code in PR #1462:
URL: https://github.com/apache/ratis/pull/1462#discussion_r3275810188
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/GrpcConfigKeys.java:
##########
@@ -87,6 +91,73 @@ static GrpcTlsConfig conf(Parameters parameters) {
static void setConf(Parameters parameters, GrpcTlsConfig conf) {
parameters.put(CONF_PARAMETER, conf, GrpcTlsConfig.class);
}
+
+ String SSL_PROVIDER_KEY = PREFIX + ".ssl.provider";
+ SslProvider SSL_PROVIDER_DEFAULT = null;
+ static SslProvider sslProvider(RaftProperties properties) {
+ return properties.getEnum(SSL_PROVIDER_KEY, SslProvider.class,
SSL_PROVIDER_DEFAULT);
+ }
+ static void setSslProvider(RaftProperties properties, SslProvider
provider) {
+ properties.setEnum(SSL_PROVIDER_KEY, provider);
+ }
+
+ String JSSE_PROVIDER_NAME_KEY = PREFIX + ".jsse.provider.name";
+ String JSSE_PROVIDER_NAME_DEFAULT = null;
+ static String jsseProviderName(RaftProperties properties) {
+ return properties.get(JSSE_PROVIDER_NAME_KEY,
JSSE_PROVIDER_NAME_DEFAULT);
+ }
+ static void setJsseProviderName(RaftProperties properties, String name) {
+ properties.set(JSSE_PROVIDER_NAME_KEY, name);
+ }
+
+ String PROTOCOLS_KEY = PREFIX + ".protocols";
+ String[] PROTOCOLS_DEFAULT = StringUtils.EMPTY_STRING_ARRAY;
+ static String[] protocols(RaftProperties properties) {
+ return StringUtils.getTrimmedStrings(properties.get(PROTOCOLS_KEY,
null));
+ }
+ static void setProtocols(RaftProperties properties, String... protocols) {
+ properties.set(PROTOCOLS_KEY, String.join(",", protocols));
+ }
+
+ String CIPHER_SUITES_KEY = PREFIX + ".cipher.suites";
+ String[] CIPHER_SUITES_DEFAULT = StringUtils.EMPTY_STRING_ARRAY;
Review Comment:
Since the GrpcTlsConfig objects are from the Parameters provided by the
application, so we don't need the new confs in Ratis -- The application should
set up everything in the GrpcTlsConfig objects before putting them in the
Parameters.
##########
ratis-grpc/src/main/java/org/apache/ratis/grpc/GrpcTlsConfig.java:
##########
@@ -34,6 +36,10 @@
*/
public class GrpcTlsConfig extends TlsConf {
private final boolean fileBasedConfig;
+ private final SslProvider sslProvider;
+ private final String jsseProviderName;
+ private final String[] protocols;
+ private final String[] cipherSuites;
Review Comment:
Let's use List and make them unmodifiable. (The code in this PR actually
copies the arrays in the get methods. Thus, using arrays do not make it more
efficient.)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]