Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions client/conf/server.properties.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ request.max.form.keys=5000
https.enable=false
https.port=8443

# Maximum HTTP request and response header sizes in bytes
request.header.size=32768
response.header.size=32768

# The keystore and manager passwords are assumed to be same.
https.keystore=/etc/cloudstack/management/cloud.jks
# If you want to encrypt the password itself, follow the steps mentioned at:
Expand Down
18 changes: 16 additions & 2 deletions client/src/main/java/org/apache/cloudstack/ServerDaemon.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ public class ServerDaemon implements Daemon {
private static final String HTTP_PORT = "http.port";
private static final String HTTPS_ENABLE = "https.enable";
private static final String HTTPS_PORT = "https.port";
private static final String REQUEST_HEADER_SIZE = "request.header.size";
private static final String RESPONSE_HEADER_SIZE = "response.header.size";
private static final String KEYSTORE_FILE = "https.keystore";
private static final String KEYSTORE_PASSWORD = "https.keystore.password";
private static final String WEBAPP_DIR = "webapp.dir";
Expand All @@ -98,6 +100,8 @@ public class ServerDaemon implements Daemon {
private boolean httpEnable = true;
private int httpPort = 8080;
private int httpsPort = 8443;
private int requestHeaderSize = 32768;
private int responseHeaderSize = 32768;
private int sessionTimeout = 30;
private int maxFormContentSize = DEFAULT_REQUEST_CONTENT_SIZE;
private int maxFormKeys = DEFAULT_REQUEST_MAX_FORM_KEYS;
Expand Down Expand Up @@ -144,6 +148,8 @@ public void init(final DaemonContext context) {
setHttpPort(Integer.valueOf(properties.getProperty(HTTP_PORT, "8080")));
setHttpsEnable(Boolean.valueOf(properties.getProperty(HTTPS_ENABLE, "false")));
setHttpsPort(Integer.valueOf(properties.getProperty(HTTPS_PORT, "8443")));
setRequestHeaderSize(Integer.valueOf(properties.getProperty(REQUEST_HEADER_SIZE, "32768")));
setResponseHeaderSize(Integer.valueOf(properties.getProperty(RESPONSE_HEADER_SIZE, "32768")));
setKeystoreFile(properties.getProperty(KEYSTORE_FILE));
setKeystorePassword(properties.getProperty(KEYSTORE_PASSWORD));
setWebAppLocation(properties.getProperty(WEBAPP_DIR));
Expand Down Expand Up @@ -189,8 +195,8 @@ public void start() throws Exception {
httpConfig.setSecureScheme("https");
httpConfig.setSecurePort(httpsPort);
httpConfig.setOutputBufferSize(32768);
httpConfig.setRequestHeaderSize(8192);
httpConfig.setResponseHeaderSize(8192);
httpConfig.setRequestHeaderSize(requestHeaderSize);
httpConfig.setResponseHeaderSize(responseHeaderSize);
httpConfig.setSendServerVersion(false);
httpConfig.setSendDateHeader(false);
addForwardingCustomiser(httpConfig);
Expand Down Expand Up @@ -365,6 +371,14 @@ public void setHttpsPort(int httpsPort) {
this.httpsPort = httpsPort;
}

public void setRequestHeaderSize(int requestHeaderSize) {
this.requestHeaderSize = requestHeaderSize;
}

public void setResponseHeaderSize(int responseHeaderSize) {
this.responseHeaderSize = responseHeaderSize;
}

public void setContextPath(String contextPath) {
this.contextPath = contextPath;
}
Expand Down