ZEPPELIN-1321 Zeppelin HTTP and HTTPS port should be managed seperately

- add new property for ssl port
This commit is contained in:
Renjith Kamath 2016-10-05 14:45:13 +05:30
parent 578fdf3e06
commit 41899b15e0
5 changed files with 21 additions and 8 deletions

View file

@ -22,6 +22,7 @@
# export ZEPPELIN_MEM # Zeppelin jvm mem options Default -Xmx1024m -XX:MaxPermSize=512m
# export ZEPPELIN_INTP_MEM # zeppelin interpreter process jvm mem options.
# export ZEPPELIN_INTP_JAVA_OPTS # zeppelin interpreter process jvm options.
# export ZEPPELIN_SSL_PORT # ssl port (used when ssl environment variable is set to true)
# export ZEPPELIN_LOG_DIR # Where log files are stored. PWD by default.
# export ZEPPELIN_PID_DIR # The pid files are stored. ${ZEPPELIN_HOME}/run by default.

View file

@ -31,6 +31,12 @@
<description>Server port.</description>
</property>
<property>
<name>zeppelin.server.ssl.port</name>
<value>8443</value>
<description>Server ssl port. (used when ssl property is set to true)</description>
</property>
<property>
<name>zeppelin.server.context.path</name>
<value>/</value>

View file

@ -211,6 +211,12 @@ You can configure Apache Zeppelin with either **environment variables** in `conf
<td>8080</td>
<td>Zeppelin server port</td>
</tr>
<tr>
<td>ZEPPELIN_SSL_PORT</td>
<td>zeppelin.server.ssl.port</td>
<td>8443</td>
<td>Zeppelin Server ssl port (used when ssl environment/property is set to true)</td>
</tr>
<tr>
<td>ZEPPELIN_MEM</td>
<td>N/A</td>

View file

@ -174,29 +174,24 @@ public class ZeppelinServer extends Application {
ServerConnector connector;
if (conf.useSsl()) {
HttpConfiguration httpConfig = new HttpConfiguration();
httpConfig.setSecureScheme("https");
httpConfig.setSecurePort(conf.getServerPort());
httpConfig.setSecurePort(conf.getServerSslPort());
httpConfig.setOutputBufferSize(32768);
HttpConfiguration httpsConfig = new HttpConfiguration(httpConfig);
SecureRequestCustomizer src = new SecureRequestCustomizer();
// Only with Jetty 9.3.x
// src.setStsMaxAge(2000);
// src.setStsIncludeSubDomains(true);
// src.setStsMaxAge(2000);
// src.setStsIncludeSubDomains(true);
httpsConfig.addCustomizer(src);
connector = new ServerConnector(
server,
new SslConnectionFactory(getSslContextFactory(conf), HttpVersion.HTTP_1_1.asString()),
new HttpConnectionFactory(httpsConfig));
} else {
connector = new ServerConnector(server);
}
// Set some timeout options to make debugging easier.

View file

@ -261,6 +261,10 @@ public class ZeppelinConfiguration extends XMLConfiguration {
return getBoolean(ConfVars.ZEPPELIN_SSL);
}
public int getServerSslPort() {
return getInt(ConfVars.ZEPPELIN_SSL_PORT);
}
public boolean useClientAuth() {
return getBoolean(ConfVars.ZEPPELIN_SSL_CLIENT_AUTH);
}
@ -489,6 +493,7 @@ public class ZeppelinConfiguration extends XMLConfiguration {
ZEPPELIN_PORT("zeppelin.server.port", 8080),
ZEPPELIN_SERVER_CONTEXT_PATH("zeppelin.server.context.path", "/"),
ZEPPELIN_SSL("zeppelin.ssl", false),
ZEPPELIN_SSL_PORT("zeppelin.server.ssl.port", 8443),
ZEPPELIN_SSL_CLIENT_AUTH("zeppelin.ssl.client.auth", false),
ZEPPELIN_SSL_KEYSTORE_PATH("zeppelin.ssl.keystore.path", "keystore"),
ZEPPELIN_SSL_KEYSTORE_TYPE("zeppelin.ssl.keystore.type", "JKS"),