You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2015/06/12 16:18:03 UTC
hbase git commit: HBASE-13848 Use Credential Provider when available
for SSL passwords in InfoServer.
Repository: hbase
Updated Branches:
refs/heads/master 7595bdfb1 -> 47a9ff5d1
HBASE-13848 Use Credential Provider when available for SSL passwords in InfoServer.
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/47a9ff5d
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/47a9ff5d
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/47a9ff5d
Branch: refs/heads/master
Commit: 47a9ff5d1f4f90fe9ddc05a478cca0d4f82fd30a
Parents: 7595bdf
Author: Sean Busbey <bu...@apache.org>
Authored: Fri Jun 5 10:22:52 2015 -0500
Committer: Sean Busbey <bu...@apache.org>
Committed: Fri Jun 12 09:12:20 2015 -0500
----------------------------------------------------------------------
.../main/java/org/apache/hadoop/hbase/http/InfoServer.java | 7 ++++---
.../java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java | 8 +++++---
2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/47a9ff5d/hbase-server/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java
index e9b76bc..1e76da9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/http/InfoServer.java
@@ -24,6 +24,7 @@ import java.net.URI;
import javax.servlet.http.HttpServlet;
+import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.hadoop.conf.Configuration;
@@ -66,12 +67,12 @@ public class InfoServer {
builder.setLogDir(logDir);
}
if (httpConfig.isSecure()) {
- builder.keyPassword(c.get("ssl.server.keystore.keypassword"))
+ builder.keyPassword(HBaseConfiguration.getPassword(c, "ssl.server.keystore.keypassword", null))
.keyStore(c.get("ssl.server.keystore.location"),
- c.get("ssl.server.keystore.password"),
+ HBaseConfiguration.getPassword(c,"ssl.server.keystore.password", null),
c.get("ssl.server.keystore.type", "jks"))
.trustStore(c.get("ssl.server.truststore.location"),
- c.get("ssl.server.truststore.password"),
+ HBaseConfiguration.getPassword(c, "ssl.server.truststore.password", null),
c.get("ssl.server.truststore.type", "jks"));
}
this.httpServer = builder.build();
http://git-wip-us.apache.org/repos/asf/hbase/blob/47a9ff5d/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java
index 1b79aff..44d122a 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/http/TestSSLHttpServer.java
@@ -29,6 +29,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileUtil;
+import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.testclassification.MiscTests;
import org.apache.hadoop.hbase.testclassification.SmallTests;
import org.apache.hadoop.hbase.http.ssl.KeyStoreTestUtil;
@@ -81,12 +82,13 @@ public class TestSSLHttpServer extends HttpServerFunctionalTest {
.setName("test")
.addEndpoint(new URI("https://localhost"))
.setConf(conf)
- .keyPassword(sslConf.get("ssl.server.keystore.keypassword"))
+ .keyPassword(HBaseConfiguration.getPassword(sslConf, "ssl.server.keystore.keypassword",
+ null))
.keyStore(sslConf.get("ssl.server.keystore.location"),
- sslConf.get("ssl.server.keystore.password"),
+ HBaseConfiguration.getPassword(sslConf, "ssl.server.keystore.password", null),
sslConf.get("ssl.server.keystore.type", "jks"))
.trustStore(sslConf.get("ssl.server.truststore.location"),
- sslConf.get("ssl.server.truststore.password"),
+ HBaseConfiguration.getPassword(sslConf, "ssl.server.truststore.password", null),
sslConf.get("ssl.server.truststore.type", "jks")).build();
server.addServlet("echo", "/echo", TestHttpServer.EchoServlet.class);
server.start();