From 3cb9888d560a17baf68853936b592cd6a429dca5 Mon Sep 17 00:00:00 2001 From: Rohith Sharma K S Date: Tue, 8 May 2018 12:28:54 +0530 Subject: [PATCH] YARN-8253. HTTPS Ats v2 api call fails with 'bad HTTP parsed'. Contributed by Charan Hebri. (cherry picked from commit 7450583721757b8af2945ebd9be1a9efed11444c) --- .../timelineservice/reader/TimelineReaderServer.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java index 2f85c046786..bd2c428c4fb 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java @@ -186,10 +186,17 @@ public class TimelineReaderServer extends CompositeService { 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() + ";"