YARN-6457. Allow custom SSL configuration to be supplied in WebApps. (Sanjay M Pujare via Haibo Chen)
(cherry picked from commit1769b12a77
) (cherry picked from commit86fcb8a66c
)
This commit is contained in:
parent
8007d024b8
commit
3799625e90
|
@ -369,16 +369,21 @@ public class WebAppUtils {
|
||||||
/**
|
/**
|
||||||
* Load the SSL keystore / truststore into the HttpServer builder.
|
* Load the SSL keystore / truststore into the HttpServer builder.
|
||||||
* @param builder the HttpServer2.Builder to populate with ssl config
|
* @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(
|
public static HttpServer2.Builder loadSslConfiguration(
|
||||||
HttpServer2.Builder builder, Configuration sslConf) {
|
HttpServer2.Builder builder, Configuration conf) {
|
||||||
if (sslConf == null) {
|
|
||||||
sslConf = new Configuration(false);
|
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;
|
boolean needsClientAuth = YarnConfiguration.YARN_SSL_CLIENT_HTTPS_NEED_AUTH_DEFAULT;
|
||||||
sslConf.addResource(YarnConfiguration.YARN_SSL_SERVER_RESOURCE_DEFAULT);
|
|
||||||
|
|
||||||
return builder
|
return builder
|
||||||
.needsClientAuth(needsClientAuth)
|
.needsClientAuth(needsClientAuth)
|
||||||
.keyPassword(getPassword(sslConf, WEB_APP_KEY_PASSWORD_KEY))
|
.keyPassword(getPassword(sslConf, WEB_APP_KEY_PASSWORD_KEY))
|
||||||
|
|
Loading…
Reference in New Issue