Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wiremock and jetty #46

Merged
merged 3 commits into from
Jan 5, 2023
Merged
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: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
16 changes: 10 additions & 6 deletions src/test/java/org/opensearch/jdbc/test/TLSServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down