|
20 | 20 | import java.net.InetAddress;
|
21 | 21 | import java.time.Duration;
|
22 | 22 | import java.util.Arrays;
|
| 23 | +import java.util.List; |
23 | 24 |
|
24 | 25 | import org.awaitility.Awaitility;
|
25 | 26 | import org.eclipse.jetty.server.ConnectionLimit;
|
|
33 | 34 | import org.springframework.boot.web.reactive.server.AbstractReactiveWebServerFactory;
|
34 | 35 | import org.springframework.boot.web.reactive.server.AbstractReactiveWebServerFactoryTests;
|
35 | 36 | import org.springframework.boot.web.server.Shutdown;
|
| 37 | +import org.springframework.boot.web.server.Ssl; |
| 38 | +import org.springframework.boot.web.server.Ssl.ServerNameSslBundle; |
36 | 39 | import org.springframework.http.server.reactive.HttpHandler;
|
37 | 40 | import org.springframework.web.reactive.function.client.WebClient;
|
38 | 41 |
|
39 | 42 | import static org.assertj.core.api.Assertions.assertThat;
|
40 | 43 | import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
| 44 | +import static org.assertj.core.api.Assertions.assertThatIllegalStateException; |
41 | 45 | import static org.mockito.ArgumentMatchers.any;
|
42 | 46 | import static org.mockito.Mockito.inOrder;
|
43 | 47 | import static org.mockito.Mockito.mock;
|
@@ -146,6 +150,19 @@ void shouldApplyMaxConnections() {
|
146 | 150 | assertThat(connectionLimit.getMaxConnections()).isOne();
|
147 | 151 | }
|
148 | 152 |
|
| 153 | + @Test |
| 154 | + void sslServerNameBundlesConfigurationThrowsException() { |
| 155 | + Ssl ssl = new Ssl(); |
| 156 | + ssl.setBundle("test"); |
| 157 | + List<ServerNameSslBundle> bundles = List.of(new ServerNameSslBundle("first", "test1"), |
| 158 | + new ServerNameSslBundle("second", "test2")); |
| 159 | + ssl.setServerNameBundles(bundles); |
| 160 | + JettyReactiveWebServerFactory factory = getFactory(); |
| 161 | + factory.setSsl(ssl); |
| 162 | + assertThatIllegalStateException().isThrownBy(() -> this.webServer = factory.getWebServer(new EchoHandler())) |
| 163 | + .withMessageContaining("Server name SSL bundles are not supported with Jetty"); |
| 164 | + } |
| 165 | + |
149 | 166 | @Override
|
150 | 167 | protected String startedLogMessage() {
|
151 | 168 | return ((JettyWebServer) this.webServer).getStartedLogMessage();
|
|
0 commit comments