YARN-8253. HTTPS Ats v2 api call fails with 'bad HTTP parsed'. Contributed by Charan Hebri.

This commit is contained in:
Rohith Sharma K S 2018-05-08 12:28:54 +05:30
parent 2916c90500
commit 7450583721

View File

@ -186,10 +186,17 @@ private void startTimelineReaderWebApp() {
LOG.info("Instantiating TimelineReaderWebApp at " + bindAddress);
try {
String httpScheme = WebAppUtils.getHttpSchemePrefix(conf);
HttpServer2.Builder builder = new HttpServer2.Builder()
.setName("timeline")
.setConf(conf)
.addEndpoint(URI.create("http://" + bindAddress));
.addEndpoint(URI.create(httpScheme + bindAddress));
if (httpScheme.equals(WebAppUtils.HTTPS_PREFIX)) {
WebAppUtils.loadSslConfiguration(builder, conf);
}
readerWebServer = builder.build();
readerWebServer.addJerseyResourcePackage(
TimelineReaderWebServices.class.getPackage().getName() + ";"