[CALCITE-4095] Update Jetty to 9.4.31.v20200723
Jetty upgrade also includes the migration to `SslContextFactory.Server` from `SslContextFactory`
Closes #125
diff --git a/gradle.properties b/gradle.properties
index fb47ead..e122584 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -68,7 +68,7 @@
jackson.version=2.10.0
jcip-annotations.version=1.0-1
jcommander.version=1.72
-jetty.version=9.4.15.v20190215
+jetty.version=9.4.31.v20200723
junit.version=4.12
kerby.version=1.1.1
mockito.version=2.23.4
diff --git a/server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java b/server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java
index 989a01b..f883b87 100644
--- a/server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java
+++ b/server/src/main/java/org/apache/calcite/avatica/server/HttpServer.java
@@ -76,7 +76,7 @@
private final AvaticaHandler handler;
private final AvaticaServerConfiguration config;
private final Subject subject;
- private final SslContextFactory sslFactory;
+ private final SslContextFactory.Server sslFactory;
private final List<ServerCustomizer<Server>> serverCustomizers;
private final int maxAllowedHeaderSize;
@@ -135,11 +135,11 @@
* @param handler The Handler to run
* @param config Optional configuration for the server
* @param subject The javax.security Subject for the server, or null
- * @param sslFactory A configured SslContextFactory, or null
+ * @param sslFactory A configured SslContextFactory.Server, or null
*/
public HttpServer(int port, AvaticaHandler handler,
AvaticaServerConfiguration config, Subject subject,
- SslContextFactory sslFactory) {
+ SslContextFactory.Server sslFactory) {
this(port, handler, config, subject, sslFactory,
Collections.<ServerCustomizer<Server>>emptyList(),
MAX_ALLOWED_HEADER_SIZE);
@@ -151,11 +151,11 @@
* @param handler The Handler to run
* @param config Optional configuration for the server
* @param subject The javax.security Subject for the server, or null
- * @param sslFactory A configured SslContextFactory, or null
+ * @param sslFactory A configured SslContextFactory.Server, or null
* @param maxAllowedHeaderSize A maximum size in bytes that are allowed in an HTTP header
*/
public HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config,
- Subject subject, SslContextFactory sslFactory, int maxAllowedHeaderSize) {
+ Subject subject, SslContextFactory.Server sslFactory, int maxAllowedHeaderSize) {
this(port, handler, config, subject, sslFactory,
Collections.<ServerCustomizer<Server>>emptyList(),
maxAllowedHeaderSize);
@@ -167,11 +167,11 @@
* @param handler The Handler to run
* @param config Optional configuration for the server
* @param subject The javax.security Subject for the server, or null
- * @param sslFactory A configured SslContextFactory, or null
+ * @param sslFactory A configured SslContextFactory.Server, or null
* @param maxAllowedHeaderSize A maximum size in bytes that are allowed in an HTTP header
*/
private HttpServer(int port, AvaticaHandler handler, AvaticaServerConfiguration config,
- Subject subject, SslContextFactory sslFactory,
+ Subject subject, SslContextFactory.Server sslFactory,
List<ServerCustomizer<Server>> serverCustomizers, int maxAllowedHeaderSize) {
this.port = port;
this.handler = handler;
@@ -798,7 +798,7 @@
throw new IllegalArgumentException("Unhandled AuthenticationType");
}
- SslContextFactory sslFactory = buildSSLContextFactory();
+ SslContextFactory.Server sslFactory = buildSSLContextFactory();
List<ServerCustomizer<Server>> jettyCustomizers = new ArrayList<>();
for (ServerCustomizer<?> customizer : this.serverCustomizers) {
@@ -810,10 +810,10 @@
maxAllowedHeaderSize);
}
- protected SslContextFactory buildSSLContextFactory() {
- SslContextFactory sslFactory = null;
+ protected SslContextFactory.Server buildSSLContextFactory() {
+ SslContextFactory.Server sslFactory = null;
if (usingTLS) {
- sslFactory = new SslContextFactory();
+ sslFactory = new SslContextFactory.Server();
sslFactory.setKeyStorePath(this.keystore.getAbsolutePath());
sslFactory.setKeyStorePassword(keystorePassword);
sslFactory.setTrustStorePath(truststore.getAbsolutePath());