HDDS-1235. BaseHttpServer NPE is HTTP policy is HTTPS_ONLY. Contributed by Xiaoyu Yao.
Closes #572 (cherry picked from commit 11db46956c6062a986caf9009d3e36049e5830d4)
This commit is contained in:
parent
6465125a5a
commit
49217971b5
@ -65,14 +65,10 @@ public abstract class BaseHttpServer {
|
||||
public BaseHttpServer(Configuration conf, String name) throws IOException {
|
||||
this.name = name;
|
||||
this.conf = conf;
|
||||
if (isEnabled()) {
|
||||
policy = DFSUtil.getHttpPolicy(conf);
|
||||
if (policy.isHttpEnabled()) {
|
||||
if (isEnabled()) {
|
||||
this.httpAddress = getHttpBindAddress();
|
||||
}
|
||||
if (policy.isHttpsEnabled()) {
|
||||
this.httpsAddress = getHttpsBindAddress();
|
||||
}
|
||||
HttpServer2.Builder builder = null;
|
||||
builder = DFSUtil.httpServerTemplateForNNAndJN(conf, this.httpAddress,
|
||||
this.httpsAddress, name, getSpnegoPrincipal(), getKeytabFile());
|
||||
|
Loading…
x
Reference in New Issue
Block a user