Skip to content

Commit

Permalink
Update wiremock and jetty. (#46)
Browse files Browse the repository at this point in the history
Signed-off-by: Yury-Fridlyand <[email protected]>

Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand authored Jan 5, 2023
1 parent 6e963e0 commit d932fba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
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

0 comments on commit d932fba

Please sign in to comment.