Skip to content

Commit

Permalink
YARN-6457. Allow custom SSL configuration to be supplied in WebApps. …
Browse files Browse the repository at this point in the history
…(Sanjay M Pujare via Haibo Chen)
  • Loading branch information
Haibo Chen committed May 8, 2017
1 parent ff5ec3b commit 1769b12
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,21 @@ public static HttpServer2.Builder loadSslConfiguration(
/**
* Load the SSL keystore / truststore into the HttpServer builder.
* @param builder the HttpServer2.Builder to populate with ssl config
* @param sslConf the Configuration instance to use during loading of SSL conf
* @param conf the Configuration instance to load custom SSL config from
*
* @return HttpServer2.Builder instance (passed in as the first parameter)
* after loading SSL stores
*/
public static HttpServer2.Builder loadSslConfiguration(
HttpServer2.Builder builder, Configuration sslConf) {
if (sslConf == null) {
sslConf = new Configuration(false);
HttpServer2.Builder builder, Configuration conf) {

Configuration sslConf = new Configuration(false);

sslConf.addResource(YarnConfiguration.YARN_SSL_SERVER_RESOURCE_DEFAULT);
if (conf != null) {
sslConf.addResource(conf);
}
boolean needsClientAuth = YarnConfiguration.YARN_SSL_CLIENT_HTTPS_NEED_AUTH_DEFAULT;
sslConf.addResource(YarnConfiguration.YARN_SSL_SERVER_RESOURCE_DEFAULT);

return builder
.needsClientAuth(needsClientAuth)
.keyPassword(getPassword(sslConf, WEB_APP_KEY_PASSWORD_KEY))
Expand Down

0 comments on commit 1769b12

Please sign in to comment.