Skip to content

Commit d087a97

Browse files
committed
Formatting
See gh-3641
1 parent 84009f2 commit d087a97

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/config/AbstractSslConfigurer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ protected HttpClientProperties.Ssl getSslProperties() {
6767
}
6868

6969
protected SslBundle getBundle() {
70-
if (ssl.getSslBundle() != null && ssl.getSslBundle().length() > 0 && bundles.getBundleNames().contains(ssl.getSslBundle())) {
70+
if (ssl.getSslBundle() != null && ssl.getSslBundle().length() > 0
71+
&& bundles.getBundleNames().contains(ssl.getSslBundle())) {
7172
return bundles.getBundle(ssl.getSslBundle());
7273
}
7374
return null;
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,52 @@
1+
/*
2+
* Copyright 2013-2023 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springframework.cloud.gateway.test.ssl;
218

319
import io.netty.handler.ssl.SslContextBuilder;
420
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
521
import org.junit.jupiter.api.BeforeEach;
22+
import reactor.netty.http.client.HttpClient;
23+
624
import org.springframework.beans.factory.annotation.Autowired;
725
import org.springframework.boot.ssl.SslBundles;
826
import org.springframework.boot.test.context.SpringBootTest;
927
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
1028
import org.springframework.test.annotation.DirtiesContext;
1129
import org.springframework.test.context.ActiveProfiles;
12-
import reactor.netty.http.client.HttpClient;
1330

1431
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT;
1532

1633
@SpringBootTest(webEnvironment = RANDOM_PORT)
1734
@DirtiesContext
1835
@ActiveProfiles("client-auth-ssl-bundle")
1936
public class ClientCertAuthSSLBundleTests extends SingleCertSSLTests {
37+
2038
@Autowired
2139
private SslBundles sslBundles;
2240

2341
@BeforeEach
2442
public void setup() throws Exception {
2543
final var sslBundle = sslBundles.getBundle("scg-keystore-with-different-key-password");
2644
final var sslContext = SslContextBuilder.forClient()
27-
.trustManager(InsecureTrustManagerFactory.INSTANCE)
28-
.keyManager(sslBundle.getManagers().getKeyManagerFactory())
29-
.build();
45+
.trustManager(InsecureTrustManagerFactory.INSTANCE)
46+
.keyManager(sslBundle.getManagers().getKeyManagerFactory())
47+
.build();
3048
HttpClient httpClient = HttpClient.create().secure(ssl -> ssl.sslContext(sslContext));
3149
setup(new ReactorClientHttpConnector(httpClient), "https://localhost:" + port);
3250
}
51+
3352
}

0 commit comments

Comments
 (0)