Skip to content

Commit fecba5a

Browse files
committed
PHOENIX-7665 Make TLS protocols and ciphersuites configurable in PQS
1 parent 58d3b13 commit fecba5a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

phoenix-queryserver/src/main/java/org/apache/phoenix/queryserver/QueryServerProperties.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ public class QueryServerProperties {
7272
"phoenix.queryserver.tls.truststore";
7373
public static final String QUERY_SERVER_TLS_TRUSTSTORE_PASSWORD =
7474
"phoenix.queryserver.tls.truststore.password";
75+
public static final String QUERY_SERVER_TLS_ENABLED_PROTCOLS =
76+
"phoenix.queryserver.tls.protocols";
77+
public static final String QUERY_SERVER_TLS_ENABLED_CIPHERSUITES =
78+
"phoenix.queryserver.tls.ciphersuites";
7579
public static final String QUERY_SERVER_JMX_JSON_ENDPOINT_DISABLED =
7680
"phoenix.queryserver.jmxjsonendpoint.disabled";
7781

phoenix-queryserver/src/main/java/org/apache/phoenix/queryserver/server/QueryServer.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,19 @@ private void setTlsIfNeccessary(Builder<Server> builder, Configuration conf) thr
297297
throw new Exception(String.format("if %s is enabled, %s must be specfified" , QueryServerProperties.QUERY_SERVER_TLS_ENABLED, QueryServerProperties.QUERY_SERVER_TLS_TRUSTSTORE));
298298
}
299299
final File tlsTruststoreFile = new File(tlsTruststore);
300-
builder.withTLS(tlsKeystoreFile, tlsKeystorePassword, tlsTruststoreFile, tlsTruststorePassword, keystoreType);
300+
301+
final String tlsEnabledProtocolsString = getConf().get(QueryServerProperties.QUERY_SERVER_TLS_ENABLED_PROTCOLS);
302+
String[] tlsEnabledProtocols = null;
303+
if (tlsEnabledProtocolsString != null) {
304+
tlsEnabledProtocols = tlsEnabledProtocolsString.trim().split(",");
305+
}
306+
final String tlsEnabledChiphersuitesString = getConf().get(QueryServerProperties.QUERY_SERVER_TLS_ENABLED_CIPHERSUITES);
307+
String[] tlsEnabledChiphersuites = null;
308+
if (tlsEnabledChiphersuitesString != null) {
309+
tlsEnabledChiphersuites = tlsEnabledChiphersuitesString.trim().split(",");
310+
}
311+
312+
builder.withTLS(tlsKeystoreFile, tlsKeystorePassword, tlsTruststoreFile, tlsTruststorePassword, keystoreType, tlsEnabledProtocols, tlsEnabledChiphersuites);
301313
}
302314
}
303315

0 commit comments

Comments
 (0)