Skip to content

Commit

Permalink
Merge pull request #2549 from MattGill98/PAYARA-2614-Add-Missing-HTTP…
Browse files Browse the repository at this point in the history
…2-Configuration-Options

PAYARA-2614 Add Missing HTTP/2 Configuration Options
  • Loading branch information
Pandrex247 committed Mar 22, 2018
2 parents 9dbf39a + 54f104d commit 216c1b4
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 64 deletions.
Expand Up @@ -148,6 +148,9 @@ maxLength.http.http2.maxConcurrentStreams=10
maxLength.http.http2.initialWindowSizeInBytes=10
maxLength.http.http2.maxFramePayloadSizeInBytes=10
maxLength.http.http2.maxHeaderListSizeInBytes=10
maxLength.http.http2.streamsHighWaterMark=10
maxLength.http.http2.cleanPercentage=10
maxLength.http.http2.cleanFrequencyCheck=10
maxLength.http.maxConnections=10
maxLength.http.redirectPort=512
maxLength.http.serverName=512
Expand Down
4 changes: 2 additions & 2 deletions appserver/admingui/web/src/main/resources/grizzly/http.layout
Expand Up @@ -39,7 +39,7 @@
holder.

-->
<!-- Portions Copyright [2017] [Payara Foundation and/or its affiliates.] -->
<!-- Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates.] -->

<!-- grizzly/http.jsf -->

Expand Down Expand Up @@ -81,7 +81,7 @@
setPageSessionAttribute(key="valueMap" value="#{pageSession.httpMap}");
setPageSessionAttribute(key="convertToFalseList"
value={"uploadTimeoutEnabled", "cometSupportEnabled", "dnsLookupEnabled", "rcmSupportEnabled", "traceEnabled", "authPassThroughEnabled",
"chunkingEnabled", "encodedSlashEnabled", "websocketsSupport", "xpoweredBy", "serverHeader", "xframeOptions", "http2Enabled", "http2DisableCipherCheck" });
"chunkingEnabled", "encodedSlashEnabled", "websocketsSupport", "xpoweredBy", "serverHeader", "xframeOptions", "http2Enabled", "http2DisableCipherCheck", "http2PushEnabled" });

//set the following for including buttons.inc

Expand Down
32 changes: 24 additions & 8 deletions appserver/admingui/web/src/main/resources/grizzly/httpAttr.inc
Expand Up @@ -40,7 +40,7 @@
-->

<!-- Portions Copyright [2017] [Payara Foundation and/or its affiliates.] -->
<!-- Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates.] -->

<!-- grizzly/httpAttr.inc -->

Expand Down Expand Up @@ -114,19 +114,15 @@
<sun:staticText id="byte" style="padding: 8pt" text="$resource{i18n.common.Bytes}"/>
</sun:property>


<sun:property id="UriEncoding" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.UriEncoding}" helpText="$resource{i18n_web.http.UriEncodingHelp}" >
<sun:textField id="UriEncoding" columns="$int{50}" maxLength="#{sessionScope.fieldLengths['maxLength.http.UriEncoding']}" text="#{pageSession.httpMap['uriEncoding']}" />
</sun:property>


<sun:property id="Http2Enabled" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.http2.enabled}" helpText="$resource{i18n_web.http.http2.enabled.help}" >
<sun:checkbox label="$resource{i18n_web.common.enabled}" selected="#{pageSession.httpMap['http2Enabled']}" selectedValue="true" />
</sun:property>

<sun:property id="Http2DisableCipherCheck" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.http2.disableCipherCheck}" helpText="$resource{i18n_web.http.http2.disableCipherCheck.help}" >
<sun:checkbox label="$resource{i18n_web.common.enabled}" selected="#{pageSession.httpMap['http2DisableCipherCheck']}" selectedValue="true" />
</sun:property>

<sun:property id="Http2MaxConcurrentStreams" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.http2.maxConcurrentStreams}" helpText="$resource{i18n_web.http.http2.maxConcurrentStreams.help}" >
<sun:textField id="Http2MaxConcurrentStreams" styleClass="integer" columns="$int{15}" maxLength="#{sessionScope.fieldLengths['maxLength.http.http2.maxConcurrentStreams']}" text="#{pageSession.httpMap['http2MaxConcurrentStreams']}" />
</sun:property>
Expand All @@ -146,10 +142,30 @@
<sun:staticText id="byte" style="padding: 8pt" text="$resource{i18n.common.Bytes}"/>
</sun:property>

<sun:property id="Compression" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.Compression}" helpText="$resource{i18n_web.http.CompressionHelp}">
<sun:dropDown id="Compression" selected="#{pageSession.httpMap['compression']}" labels={"on","off","force"} />
<sun:property id="Http2StreamsHighWaterMark" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.http2.streamsHighWaterMark}" helpText="$resource{i18n_web.http.http2.streamsHighWaterMark.help}" >
<sun:textField id="Http2StreamsHighWaterMark" columns="$int{15}" maxLength="#{sessionScope.fieldLengths['maxLength.http.http2.streamsHighWaterMark']}" text="#{pageSession.httpMap['http2StreamsHighWaterMark']}" />
</sun:property>

<sun:property id="Http2CleanPercentage" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.http2.cleanPercentage}" helpText="$resource{i18n_web.http.http2.cleanPercentage.help}" >
<sun:textField id="Http2CleanPercentage" columns="$int{15}" maxLength="#{sessionScope.fieldLengths['maxLength.http.http2.cleanPercentage']}" text="#{pageSession.httpMap['http2CleanPercentage']}" />
</sun:property>

<sun:property id="Http2CleanFrequencyCheck" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.http2.cleanFrequencyCheck}" helpText="$resource{i18n_web.http.http2.cleanFrequencyCheck.help}" >
<sun:textField id="Http2CleanFrequencyCheck" styleClass="integer" columns="$int{15}" maxLength="#{sessionScope.fieldLengths['maxLength.http.http2.cleanFrequencyCheck']}" text="#{pageSession.httpMap['http2CleanFrequencyCheck']}" />
</sun:property>

<sun:property id="Http2DisableCipherCheck" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.http2.disableCipherCheck}" helpText="$resource{i18n_web.http.http2.disableCipherCheck.help}" >
<sun:checkbox label="$resource{i18n_web.common.enabled}" selected="#{pageSession.httpMap['http2DisableCipherCheck']}" selectedValue="true" />
</sun:property>

<sun:property id="Http2PushEnabled" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.http2.pushEnabled}" helpText="$resource{i18n_web.http.http2.pushEnabled.help}" >
<sun:checkbox label="$resource{i18n_web.common.enabled}" selected="#{pageSession.httpMap['http2PushEnabled']}" selectedValue="true" />
</sun:property>


<sun:property id="Compression" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.Compression}" helpText="$resource{i18n_web.http.CompressionHelp}">
<sun:dropDown id="Compression" selected="#{pageSession.httpMap['compression']}" labels={"on","off","force"} />
</sun:property>

<sun:property id="CompressableMimeType" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.CompressableMimeType}" helpText="$resource{i18n_web.http.CompressableMimeTypeHelp}" >
<sun:textField id="CompressableMimeType" columns="$int{50}" maxLength="#{sessionScope.fieldLengths['maxLength.http.CompressableMimeType']}" text="#{pageSession.httpMap['compressableMimeType']}" />
Expand Down
Expand Up @@ -37,7 +37,8 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
# Portions Copyright [2016-2017] [Payara Foundation and/or its affiliates.]
# Portions Copyright [2016-2018] [Payara Foundation and/or its affiliates.]

button.GetStatistics=Get Statistics

## All the msg.JS.xxx strings are showed by JavaScript in a popup window. Ensure that no ' (apostrophe) is included in them
Expand Down Expand Up @@ -275,16 +276,24 @@ http.UriEncodingHelp=Character set used to decode the request URIs received

http.http2.enabled=HTTP/2:
http.http2.enabled.help=Enable HTTP/2.
http.http2.disableCipherCheck=Disable HTTP/2 Cipher Check:
http.http2.disableCipherCheck.help=Whether or not insecure cipher suites are allowed to establish TLS connections.
http.http2.maxConcurrentStreams=HTTP/2 Max Concurrent Streams:
http.http2.maxConcurrentStreams.help=The number of concurrent streams allowed per HTTP/2 connection. The default is 100.
http.http2.initialWindowSizeInBytes=HTTP/2 Initial Window Size:
http.http2.initialWindowSizeInBytes.help=The initial window size in bytes. The default is 64K - 1.
http.http2.maxFramePayloadSizeInBytes=HTTP/2 Max Frame Payload Size:
http.http2.maxFramePayloadSizeInBytes.help=The maximum size of the HTTP2 frame payload to be accepted. The default is 2^24 - 1.
http.http2.maxFramePayloadSizeInBytes.help=The maximum size of the HTTP2 frame payload to be accepted. The default is 2^24 - 1.
http.http2.maxHeaderListSizeInBytes=HTTP/2 Max Header List Size:
http.http2.maxHeaderListSizeInBytes.help=The maximum size, in bytes, of the header list.
http.http2.maxHeaderListSizeInBytes.help=The maximum size, in bytes, of the header list. The default is 4096.
http.http2.streamsHighWaterMark=HTTP/2 Streams High Water Mark:
http.http2.streamsHighWaterMark.help=Streams are periodically cleaned when the stream count exceeds this value, as a proportion of the max concurrent streams. The default is 0.5.
http.http2.cleanPercentage=HTTP/2 Clean Percentage:
http.http2.cleanPercentage.help=The number of streams to process when the high water mark is exceeded. Only closed streams will be removed. The default is 0.5.
http.http2.cleanFrequencyCheck=HTTP/2 Clean Frequency Check:
http.http2.cleanFrequencyCheck.help=The number of streams that must be closed before checking if the number of streams exceeds the high water mark. The default is 50.
http.http2.disableCipherCheck=Disable HTTP/2 Cipher Check:
http.http2.disableCipherCheck.help=Whether or not insecure cipher suites are allowed to establish TLS connections.
http.http2.pushEnabled=HTTP/2 Push Enabled:
http.http2.pushEnabled.help=Whether or not push is allowed by the server endpoints. The default is true.

http.CompressableMimeType=Compressible Mime Types:
http.CompressableMimeTypeHelp=Comma-separated list of MIME types for which HTTP compression is used
Expand Down
Expand Up @@ -36,10 +36,9 @@
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*
* Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates]
*/

// Portions Copyright [2017] [Payara Foundation and/or its affiliates]

package org.glassfish.web.admin.cli;

import org.glassfish.internal.api.Target;
Expand Down Expand Up @@ -122,16 +121,24 @@ public class CreateHttp implements AdminCommand {

@Param(name = "http2Enabled", alias = "http2enabled", optional = true, defaultValue = "true")
Boolean http2Enabled;
@Param(name = "http2DisableCipherCheck", alias = "http2disableCipherCheck", optional = true)
Boolean http2DisableCipherCheck;
@Param(name = "http2MaxConcurrentStreams", alias = "http2maxConcurrentStreams", optional = true)
@Param(name = "http2MaxConcurrentStreams", alias = "http2maxconcurrentstreams", optional = true)
Integer http2MaxConcurrentStreams;
@Param(name = "http2InitialWindowSizeInBytes", alias = "http2initialWindowSizeInBytes", optional = true)
@Param(name = "http2InitialWindowSizeInBytes", alias = "http2initialwindowsizeinbytes", optional = true)
Integer http2InitialWindowSizeInBytes;
@Param(name = "http2MaxFramePayloadSizeInBytes", alias = "http2maxFramePayloadSizeInBytes", optional = true)
@Param(name = "http2MaxFramePayloadSizeInBytes", alias = "http2maxframepayloadsizeinbytes", optional = true)
Integer http2MaxFramePayloadSizeInBytes;
@Param(name = "http2MaxHeaderListSizeInBytes", alias = "http2maxHeaderListSizeInBytes", optional = true)
@Param(name = "http2MaxHeaderListSizeInBytes", alias = "http2maxheaderlistsizeinbytes", optional = true)
Integer http2MaxHeaderListSizeInBytes;
@Param(name = "http2StreamsHighWaterMark", alias = "http2streamshighwatermark", optional = true)
Float http2StreamsHighWaterMark;
@Param(name = "http2CleanPercentage", alias = "http2cleanpercentage", optional = true)
Float http2CleanPercentage;
@Param(name = "http2CleanFrequencyCheck", alias = "http2cleanfrequencycheck", optional = true)
Integer http2CleanFrequencyCheck;
@Param(name = "http2DisableCipherCheck", alias = "http2disableciphercheck", optional = true)
Boolean http2DisableCipherCheck;
@Param(name = "http2PushEnabled", alias = "http2pushenabled", optional = true)
Boolean http2PushEnabled;


@Param(name = "target", optional = true, defaultValue = SystemPropertyConstants.DAS_SERVER_NAME)
Expand Down Expand Up @@ -197,21 +204,33 @@ public Object run(Protocol param) throws TransactionFailure {

// HTTP2 options
http.setHttp2Enabled(http2Enabled);
if (http2DisableCipherCheck != null) {
http.setHttp2DisableCipherCheck(http2DisableCipherCheck);
if (http2MaxConcurrentStreams != null) {
http.setHttp2MaxConcurrentStreams(http2MaxConcurrentStreams);
}
if (http2InitialWindowSizeInBytes != null) {
http.setHttp2InitialWindowSizeInBytes(http2InitialWindowSizeInBytes);
}
if (http2MaxConcurrentStreams != null) {
http.setHttp2MaxConcurrentStreams(http2MaxConcurrentStreams);
}
if (http2MaxFramePayloadSizeInBytes != null) {
http.setHttp2MaxFramePayloadSizeInBytes(http2MaxFramePayloadSizeInBytes);
}
if (http2MaxHeaderListSizeInBytes != null) {
http.setHttp2MaxHeaderListSizeInBytes(http2MaxHeaderListSizeInBytes);
}
if (http2StreamsHighWaterMark != null) {
http.setHttp2StreamsHighWaterMark(http2StreamsHighWaterMark.toString());
}
if (http2CleanPercentage != null) {
http.setHttp2CleanPercentage(http2CleanPercentage.toString());
}
if (http2CleanFrequencyCheck != null) {
http.setHttp2CleanFrequencyCheck(http2CleanFrequencyCheck);
}
if (http2DisableCipherCheck != null) {
http.setHttp2DisableCipherCheck(http2DisableCipherCheck);
}
if (http2PushEnabled != null) {
http.setHttp2PushEnabled(http2PushEnabled);
}
param.setHttp(http);
return http;
}
Expand Down
Expand Up @@ -36,10 +36,9 @@
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*
* Portions Copyright [2017-2018] [Payara Foundation and/or its affiliates]
*/

// Portions Copyright [2017] [Payara Foundation and/or its affiliates]

package org.glassfish.web.admin.cli;

import java.beans.PropertyVetoException;
Expand Down Expand Up @@ -123,16 +122,24 @@ public class CreateHttpListener implements AdminCommand {

@Param(name = "http2Enabled", alias = "http2enabled", optional = true, defaultValue = "true")
Boolean http2Enabled;
@Param(name = "http2DisableCipherCheck", alias = "http2disableCipherCheck", optional = true)
Boolean http2DisableCipherCheck;
@Param(name = "http2MaxConcurrentStreams", alias = "http2maxConcurrentStreams", optional = true)
@Param(name = "http2MaxConcurrentStreams", alias = "http2maxconcurrentstreams", optional = true)
Integer http2MaxConcurrentStreams;
@Param(name = "http2InitialWindowSizeInBytes", alias = "http2initialWindowSizeInBytes", optional = true)
@Param(name = "http2InitialWindowSizeInBytes", alias = "http2initialwindowsizeinbytes", optional = true)
Integer http2InitialWindowSizeInBytes;
@Param(name = "http2MaxFramePayloadSizeInBytes", alias = "http2maxFramePayloadSizeInBytes", optional = true)
@Param(name = "http2MaxFramePayloadSizeInBytes", alias = "http2maxframepayloadsizeinbytes", optional = true)
Integer http2MaxFramePayloadSizeInBytes;
@Param(name = "http2MaxHeaderListSizeInBytes", alias = "http2maxHeaderListSizeInBytes", optional = true)
@Param(name = "http2MaxHeaderListSizeInBytes", alias = "http2maxheaderlistsizeinbytes", optional = true)
Integer http2MaxHeaderListSizeInBytes;
@Param(name = "http2StreamsHighWaterMark", alias = "http2streamshighwatermark", optional = true)
Float http2StreamsHighWaterMark;
@Param(name = "http2CleanPercentage", alias = "http2cleanpercentage", optional = true)
Float http2CleanPercentage;
@Param(name = "http2CleanFrequencyCheck", alias = "http2cleanfrequencycheck", optional = true)
Integer http2CleanFrequencyCheck;
@Param(name = "http2DisableCipherCheck", alias = "http2disableciphercheck", optional = true)
Boolean http2DisableCipherCheck;
@Param(name = "http2PushEnabled", alias = "http2pushenabled", optional = true)
Boolean http2PushEnabled;

@Param(name = "target", optional = true, defaultValue = SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME)
String target;
Expand Down Expand Up @@ -373,11 +380,15 @@ private boolean createHttp(final AdminCommandContext context) throws Transaction
command.serverName = serverName;
command.target = target;
command.http2Enabled = http2Enabled;
command.http2DisableCipherCheck = http2DisableCipherCheck;
command.http2MaxConcurrentStreams = http2MaxConcurrentStreams;
command.http2InitialWindowSizeInBytes = http2InitialWindowSizeInBytes;
command.http2MaxFramePayloadSizeInBytes = http2MaxFramePayloadSizeInBytes;
command.http2MaxHeaderListSizeInBytes = http2MaxHeaderListSizeInBytes;
command.http2StreamsHighWaterMark = http2StreamsHighWaterMark;
command.http2CleanPercentage = http2CleanPercentage;
command.http2CleanFrequencyCheck = http2CleanFrequencyCheck;
command.http2DisableCipherCheck = http2DisableCipherCheck;
command.http2PushEnabled = http2PushEnabled;
command.execute(context);
checkProgress(context);
return true;
Expand Down

0 comments on commit 216c1b4

Please sign in to comment.