Skip to content

Commit 946e826

Browse files
committed
Upgrade to Jetty 9.4.15.v20190215
In addition to upgrading to Jetty 9.4.15, this commit updates the KeyStores used in embedded container testing to add to their entries subject alternative name extensions for localhost and 127.0.0.1. As of 9.4.16, Jetty requires the SAN extensions. Closes spring-projectsgh-16188
1 parent dfe6bf0 commit 946e826

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

spring-boot-dependencies/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
<jedis.version>2.9.3</jedis.version>
113113
<jersey.version>2.25.1</jersey.version>
114114
<jest.version>2.0.4</jest.version>
115-
<jetty.version>9.4.14.v20181114</jetty.version>
115+
<jetty.version>9.4.15.v20190215</jetty.version>
116116
<jetty-jsp.version>2.2.0.v201112011158</jetty-jsp.version>
117117
<jetty-el.version>8.0.33</jetty-el.version>
118118
<jms-api.version>1.1-rev-1</jms-api.version>

spring-boot/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactoryTests.java

+39-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
2626
import java.net.InetSocketAddress;
2727
import java.net.MalformedURLException;
2828
import java.net.ServerSocket;
29+
import java.net.Socket;
2930
import java.net.URI;
3031
import java.net.URISyntaxException;
3132
import java.net.URL;
@@ -72,6 +73,8 @@
7273
import org.apache.http.impl.client.HttpClientBuilder;
7374
import org.apache.http.impl.client.HttpClients;
7475
import org.apache.http.protocol.HttpContext;
76+
import org.apache.http.ssl.PrivateKeyDetails;
77+
import org.apache.http.ssl.PrivateKeyStrategy;
7578
import org.apache.http.ssl.SSLContextBuilder;
7679
import org.apache.http.ssl.TrustStrategy;
7780
import org.apache.jasper.EmbeddedServletOptions;
@@ -459,7 +462,7 @@ public void sslKeyAlias() throws Exception {
459462
this.container = factory.getEmbeddedServletContainer(registration);
460463
this.container.start();
461464
TrustStrategy trustStrategy = new SerialNumberValidatingTrustSelfSignedStrategy(
462-
"77e7c302");
465+
"5c7ae101");
463466
SSLContext sslContext = new SSLContextBuilder()
464467
.loadTrustMaterial(null, trustStrategy).build();
465468
HttpClient httpClient = HttpClients.custom()
@@ -535,7 +538,18 @@ public void pkcs12KeyStoreAndTrustStore() throws Exception {
535538
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(
536539
new SSLContextBuilder()
537540
.loadTrustMaterial(null, new TrustSelfSignedStrategy())
538-
.loadKeyMaterial(keyStore, "secret".toCharArray()).build());
541+
.loadKeyMaterial(keyStore, "secret".toCharArray(),
542+
new PrivateKeyStrategy() {
543+
544+
@Override
545+
public String chooseAlias(
546+
Map<String, PrivateKeyDetails> aliases,
547+
Socket socket) {
548+
return "spring-boot";
549+
}
550+
551+
})
552+
.build());
539553
HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory)
540554
.build();
541555
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(
@@ -559,7 +573,17 @@ public void sslNeedsClientAuthenticationSucceedsWithClientCertificate()
559573
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(
560574
new SSLContextBuilder()
561575
.loadTrustMaterial(null, new TrustSelfSignedStrategy())
562-
.loadKeyMaterial(keyStore, "password".toCharArray()).build());
576+
.loadKeyMaterial(keyStore, "password".toCharArray(),
577+
new PrivateKeyStrategy() {
578+
579+
@Override
580+
public String chooseAlias(
581+
Map<String, PrivateKeyDetails> aliases,
582+
Socket socket) {
583+
return "spring-boot";
584+
}
585+
})
586+
.build());
563587
HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory)
564588
.build();
565589
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(
@@ -648,7 +672,17 @@ public void sslWithCustomSslStoreProvider() throws Exception {
648672
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(
649673
new SSLContextBuilder()
650674
.loadTrustMaterial(null, new TrustSelfSignedStrategy())
651-
.loadKeyMaterial(keyStore, "password".toCharArray()).build());
675+
.loadKeyMaterial(keyStore, "password".toCharArray(),
676+
new PrivateKeyStrategy() {
677+
678+
@Override
679+
public String chooseAlias(
680+
Map<String, PrivateKeyDetails> aliases,
681+
Socket socket) {
682+
return "spring-boot";
683+
}
684+
})
685+
.build());
652686
HttpClient httpClient = HttpClients.custom().setSSLSocketFactory(socketFactory)
653687
.build();
654688
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(
1.02 KB
Binary file not shown.
2.89 KB
Binary file not shown.

0 commit comments

Comments
 (0)