Skip to content

Commit

Permalink
Update to Jetty 9.4.55.v20240627
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilCollooru committed Jul 31, 2024
1 parent 63c13d6 commit 2a57170
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public JettyHttpClient(

creationLocation.fillInStackTrace();

SslContextFactory sslContextFactory = new SslContextFactory();
SslContextFactory.Client sslContextFactory = new SslContextFactory.Client();
sslContextFactory.setEndpointIdentificationAlgorithm("HTTPS");
if (config.getKeyStorePath() != null) {
Optional<KeyStore> pemKeyStore = tryLoadPemKeyStore(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ public void abstractSetup()
if (keystore != null) {
httpConfiguration.addCustomizer(new SecureRequestCustomizer());

SslContextFactory sslContextFactory = new SslContextFactory(keystore);
SslContextFactory.Client sslContextFactory = new SslContextFactory.Client();
sslContextFactory.setKeyStorePath(keystore);
sslContextFactory.setKeyStorePassword("changeit");
SslConnectionFactory sslConnectionFactory = new SslConnectionFactory(sslContextFactory, "http/1.1");

Expand Down Expand Up @@ -726,7 +727,7 @@ public void testCompressionIsDisabled()
assertEquals(body, "");
assertFalse(servlet.getRequestHeaders().containsKey(HeaderName.of(ACCEPT_ENCODING)));

String json = "{\"foo\":\"bar\",\"hello\":\"world\"}";
String json = "{\"fruit\":\"apple\",\"hello\":\"world\"}";
assertGreaterThanOrEqual(json.length(), GzipHandler.DEFAULT_MIN_GZIP_SIZE);

servlet.setResponseBody(json);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void testValidations()

private List<String> getJettyDefaultExcludedCiphers()
{
SslContextFactory sslContextFactory = new SslContextFactory();
SslContextFactory.Client sslContextFactory = new SslContextFactory.Client();
return Arrays.asList(sslContextFactory.getExcludeCipherSuites());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,18 @@ public Request cookie(HttpCookie cookie)
throw new UnsupportedOperationException();
}

@Override
public Request tag(Object o)
{
return null;
}

@Override
public Object getTag()
{
return null;
}

@Override
public Request attribute(String name, Object value)
{
Expand Down Expand Up @@ -539,6 +551,12 @@ public Request onResponseContentAsync(Response.AsyncContentListener listener)
throw new UnsupportedOperationException();
}

@Override
public Request onResponseContentDemanded(Response.DemandedContentListener demandedContentListener)
{
return null;
}

@Override
public Request onResponseSuccess(Response.SuccessListener listener)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public HttpServer(HttpServerInfo httpServerInfo,
HttpConfiguration httpsConfiguration = new HttpConfiguration(baseHttpConfiguration);
httpsConfiguration.addCustomizer(new SecureRequestCustomizer(config.isSniHostCheck()));

SslContextFactory sslContextFactory = new SslContextFactory();
SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
Optional<KeyStore> pemKeyStore = tryLoadPemKeyStore(config);
if (pemKeyStore.isPresent()) {
sslContextFactory.setKeyStore(pemKeyStore.get());
Expand Down Expand Up @@ -300,7 +300,7 @@ public HttpServer(HttpServerInfo httpServerInfo,
if (config.isHttpsEnabled()) {
adminConfiguration.addCustomizer(new SecureRequestCustomizer());

SslContextFactory sslContextFactory = new SslContextFactory();
SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
sslContextFactory.setKeyStorePath(config.getKeystorePath());
sslContextFactory.setKeyStorePassword(config.getKeystorePassword());
if (config.getKeyManagerPassword() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private HttpServerConfig createHttpServerConfig()
private static HttpClient createClientIncludeCiphers(String... includedCipherSuites)
throws Exception
{
SslContextFactory sslContextFactory = new SslContextFactory();
SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
sslContextFactory.setIncludeCipherSuites(includedCipherSuites);
// Since Jetty 9.4.12 the list of excluded cipher suites includes "^TLS_RSA_.*$" by default.
// We reset that list here to enable use of those cipher suites.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public void testExplicitPropertyMappings()

private List<String> getJettyDefaultExcludedCiphers()
{
SslContextFactory sslContextFactory = new SslContextFactory();
SslContextFactory.Server sslContextFactory = new SslContextFactory.Server();
return Arrays.asList(sslContextFactory.getExcludeCipherSuites());
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<dep.airlift.version>0.214-SNAPSHOT</dep.airlift.version>
<dep.packaging.version>${dep.airlift.version}</dep.packaging.version>
<dep.jetty.version>9.4.14.v20181114</dep.jetty.version>
<dep.jetty.version>9.4.55.v20240627</dep.jetty.version>
<dep.jersey.version>2.26</dep.jersey.version>
<dep.drift.version>1.31</dep.drift.version>
</properties>
Expand Down

0 comments on commit 2a57170

Please sign in to comment.