diff --git a/build.gradle b/build.gradle index 8333aec..ebbf997 100644 --- a/build.gradle +++ b/build.gradle @@ -52,11 +52,11 @@ dependencies { testImplementation('org.junit.jupiter:junit-jupiter-api:5.3.1') testImplementation('org.junit.jupiter:junit-jupiter-params:5.3.1') - testImplementation('com.github.tomakehurst:wiremock-jre8-standalone:2.34.0') + testImplementation('com.github.tomakehurst:wiremock:3.0.0-beta-2') testImplementation('org.mockito:mockito-core:2.23.0') testImplementation('org.junit.jupiter:junit-jupiter-engine:5.3.1') testImplementation('org.junit-pioneer:junit-pioneer:0.3.0') - testImplementation('org.eclipse.jetty:jetty-server:9.4.48.v20220622') + testImplementation('org.eclipse.jetty:jetty-server:11.0.12') // Enforce wiremock to use latest guava and json-smart testImplementation('com.google.guava:guava:31.1-jre') diff --git a/src/test/java/org/opensearch/jdbc/test/TLSServer.java b/src/test/java/org/opensearch/jdbc/test/TLSServer.java index 1bd7cb8..ff108f0 100644 --- a/src/test/java/org/opensearch/jdbc/test/TLSServer.java +++ b/src/test/java/org/opensearch/jdbc/test/TLSServer.java @@ -6,6 +6,8 @@ package org.opensearch.jdbc.test; +import org.eclipse.jetty.server.HttpConnectionFactory; +import org.eclipse.jetty.server.SslConnectionFactory; import org.opensearch.jdbc.internal.util.UrlParser; import org.opensearch.jdbc.test.mocks.MockOpenSearch; import org.eclipse.jetty.server.ConnectionFactory; @@ -20,9 +22,9 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.ssl.SslContextFactory; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; public class TLSServer { @@ -83,17 +85,19 @@ public static Server startSecureServer( sslContextFactory.setNeedClientAuth(needClientAuth); HttpConfiguration httpConfig = new HttpConfiguration(); - httpConfig.addCustomizer(new SecureRequestCustomizer()); + SecureRequestCustomizer src = new SecureRequestCustomizer(); + src.setSniHostCheck(false); + httpConfig.addCustomizer(src); httpsConnector = createServerConnector( jettyServer, host, 0, - new org.eclipse.jetty.server.SslConnectionFactory( + new SslConnectionFactory( sslContextFactory, "http/1.1" ), - new org.eclipse.jetty.server.HttpConnectionFactory(httpConfig) + new HttpConnectionFactory(httpConfig) ); jettyServer.addConnector(httpsConnector);