diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/etc/protonego-alpn.xml b/jetty-alpn/jetty-alpn-server/src/main/config/etc/protonego-alpn.xml index 657f8836e37..e3a15f29f04 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/etc/protonego-alpn.xml +++ b/jetty-alpn/jetty-alpn-server/src/main/config/etc/protonego-alpn.xml @@ -15,9 +15,12 @@ - - + + + + + diff --git a/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnectionFactory.java b/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnectionFactory.java index 3a0e50853a5..fdceb842fac 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnectionFactory.java +++ b/jetty-alpn/jetty-alpn-server/src/main/java/org/eclipse/jetty/alpn/server/ALPNServerConnectionFactory.java @@ -34,9 +34,9 @@ public class ALPNServerConnectionFactory extends NegotiatingServerConnectionFact { private static final Logger LOG = Log.getLogger(ALPNServerConnectionFactory.class); - public ALPNServerConnectionFactory() + public ALPNServerConnectionFactory(String protocols) { - this(new String[]{}); + this(protocols.split(",")); } public ALPNServerConnectionFactory(@Name("protocols") String... protocols) diff --git a/jetty-distribution/src/main/resources/modules/ssl-protonego.mod b/jetty-distribution/src/main/resources/modules/ssl-protonego.mod index 4a348a68297..ef4e50412cd 100644 --- a/jetty-distribution/src/main/resources/modules/ssl-protonego.mod +++ b/jetty-distribution/src/main/resources/modules/ssl-protonego.mod @@ -1,5 +1,5 @@ # -# SSL Protonegotiate module +# SSL Protocol Negotiatiation Module # [depend] diff --git a/jetty-http2/http2-server/src/main/config/modules/http2.mod b/jetty-http2/http2-server/src/main/config/modules/http2.mod index f1a43941a97..873e645f051 100644 --- a/jetty-http2/http2-server/src/main/config/modules/http2.mod +++ b/jetty-http2/http2-server/src/main/config/modules/http2.mod @@ -14,3 +14,8 @@ etc/jetty-http2.xml [ini-template] ## HTTP2 Configuration +# Advertised protocols +protonego.protocols=h2-14,http/1.1 +protonego.defaultProtocol=http/1.1 + +# http2.maxConcurrentStreams=1024 diff --git a/jetty-npn/jetty-npn-server/src/main/config/etc/protonego-npn.xml b/jetty-npn/jetty-npn-server/src/main/config/etc/protonego-npn.xml index 2a24f6ca2d4..56b8d0bd265 100644 --- a/jetty-npn/jetty-npn-server/src/main/config/etc/protonego-npn.xml +++ b/jetty-npn/jetty-npn-server/src/main/config/etc/protonego-npn.xml @@ -16,18 +16,17 @@ - - - + + + + + - - - + + diff --git a/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnectionFactory.java b/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnectionFactory.java index 39da0c404c9..f62f82c1a6c 100644 --- a/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnectionFactory.java +++ b/jetty-npn/jetty-npn-server/src/main/java/org/eclipse/jetty/npn/server/NPNServerConnectionFactory.java @@ -34,9 +34,9 @@ public class NPNServerConnectionFactory extends NegotiatingServerConnectionFacto { private static final Logger LOG = Log.getLogger(NPNServerConnectionFactory.class); - public NPNServerConnectionFactory() + public NPNServerConnectionFactory(String protocols) { - this(new String[]{}); + this(protocols.split(",")); } public NPNServerConnectionFactory(@Name("protocols") String... protocols) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnectionFactory.java b/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnectionFactory.java index 2daafb80f48..fa7ed65fc27 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnectionFactory.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnectionFactory.java @@ -19,10 +19,8 @@ package org.eclipse.jetty.server; import java.util.ArrayList; -import java.util.Arrays; import java.util.Iterator; import java.util.List; - import javax.net.ssl.SSLEngine; import org.eclipse.jetty.io.AbstractConnection; @@ -60,7 +58,10 @@ public abstract class NegotiatingServerConnectionFactory extends AbstractConnect public NegotiatingServerConnectionFactory(String protocol, String... protocols) { super(protocol); - this.protocols = new ArrayList(Arrays.asList(protocols)); + this.protocols = new ArrayList<>(); + // Trim the values, as they may come from XML configuration. + for (String p : protocols) + this.protocols.add(p.trim()); } public String getDefaultProtocol() @@ -70,7 +71,8 @@ public abstract class NegotiatingServerConnectionFactory extends AbstractConnect public void setDefaultProtocol(String defaultProtocol) { - this.defaultProtocol = defaultProtocol; + // Trim the value, as it may come from XML configuration. + this.defaultProtocol = defaultProtocol.trim(); } public List getProtocols() @@ -78,11 +80,6 @@ public abstract class NegotiatingServerConnectionFactory extends AbstractConnect return protocols; } - public void adProtocol(String protocol) - { - protocols.add(protocol); - } - @Override public Connection newConnection(Connector connector, EndPoint endPoint) { diff --git a/jetty-spdy/spdy-http-server/src/main/config/modules/spdy.mod b/jetty-spdy/spdy-http-server/src/main/config/modules/spdy.mod index cb4cf971c7d..aa224c620cd 100644 --- a/jetty-spdy/spdy-http-server/src/main/config/modules/spdy.mod +++ b/jetty-spdy/spdy-http-server/src/main/config/modules/spdy.mod @@ -15,5 +15,8 @@ etc/jetty-spdy.xml [ini-template] ## SPDY Configuration -# Initial Window Size for SPDY -#spdy.initialWindowSize=65536 +# Advertised protocols +protonego.protocols=spdy/3,http/1.1 +protonego.defaultProtocol=http/1.1 + +# spdy.initialWindowSize=65536