Skip to content

Commit 1769b12

Browse files
author
Haibo Chen
committed
YARN-6457. Allow custom SSL configuration to be supplied in WebApps. (Sanjay M Pujare via Haibo Chen)
1 parent ff5ec3b commit 1769b12

File tree

1 file changed

+11
-6
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util

1 file changed

+11
-6
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/util/WebAppUtils.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,21 @@ public static HttpServer2.Builder loadSslConfiguration(
375375
/**
376376
* Load the SSL keystore / truststore into the HttpServer builder.
377377
* @param builder the HttpServer2.Builder to populate with ssl config
378-
* @param sslConf the Configuration instance to use during loading of SSL conf
378+
* @param conf the Configuration instance to load custom SSL config from
379+
*
380+
* @return HttpServer2.Builder instance (passed in as the first parameter)
381+
* after loading SSL stores
379382
*/
380383
public static HttpServer2.Builder loadSslConfiguration(
381-
HttpServer2.Builder builder, Configuration sslConf) {
382-
if (sslConf == null) {
383-
sslConf = new Configuration(false);
384+
HttpServer2.Builder builder, Configuration conf) {
385+
386+
Configuration sslConf = new Configuration(false);
387+
388+
sslConf.addResource(YarnConfiguration.YARN_SSL_SERVER_RESOURCE_DEFAULT);
389+
if (conf != null) {
390+
sslConf.addResource(conf);
384391
}
385392
boolean needsClientAuth = YarnConfiguration.YARN_SSL_CLIENT_HTTPS_NEED_AUTH_DEFAULT;
386-
sslConf.addResource(YarnConfiguration.YARN_SSL_SERVER_RESOURCE_DEFAULT);
387-
388393
return builder
389394
.needsClientAuth(needsClientAuth)
390395
.keyPassword(getPassword(sslConf, WEB_APP_KEY_PASSWORD_KEY))

0 commit comments

Comments
 (0)