Skip to content

Commit eeac38b

Browse files
committed
Make 'org.springframework.boot.ssl` a foundational package
Closes gh-47219
1 parent b9be117 commit eeac38b

File tree

4 files changed

+52
-5
lines changed

4 files changed

+52
-5
lines changed

config/checkstyle/checkstyle-suppressions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<suppress files="AbstractLaunchScriptIntegrationTests" checks="IllegalImport" />
6464
<suppress files="FailureAnalyzers\.java" checks="RedundantModifier" />
6565
<suppress files="SpringBootVersion" checks="JavadocPackage" />
66+
<suppress files="SpringBootProviderVersion" checks="JavadocPackage" />
6667
<suppress files="spring-boot-configuration-processor[\\/]src[\\/]test[\\/]java[\\/]org[\\/]springframework[\\/]boot[\\/]configurationsample[\\/]" checks="SpringDeprecatedCheck"/>
6768
<suppress files="ImportTestcontainersTests\.java" checks="InterfaceIsType" />
6869
<suppress files="MyContainers\.java" checks="InterfaceIsType" />

config/checkstyle/import-control.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
<!-- Allow other imports -->
1414
<allow pkg=".*" regex="true" />
1515

16+
<!-- Keep foundation packages away from SpringApplication package -->
17+
<subpackage name="ssl">
18+
<disallow pkg="org.springframework.boot" exact-match="true"/>
19+
</subpackage>
20+
1621
<!-- Open direct use of micrometer to specific subpackages -->
1722
<subpackage name="metrics">
1823
<allow pkg="io.micrometer" />

core/spring-boot/src/main/java/org/springframework/boot/ssl/FixedTrustManagerFactory.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import javax.net.ssl.TrustManagerFactory;
2525
import javax.net.ssl.TrustManagerFactorySpi;
2626

27-
import org.springframework.boot.SpringBootVersion;
28-
2927
/**
3028
* {@link TrustManagerFactory} which uses a fixed set of {@link TrustManager
3129
* TrustManagers}.
@@ -34,9 +32,7 @@
3432
*/
3533
final class FixedTrustManagerFactory extends TrustManagerFactory {
3634

37-
private static final Provider PROVIDER = new Provider("FixedTrustManagerFactory", SpringBootVersion.getVersion(),
38-
"") {
39-
};
35+
private static final Provider PROVIDER = new FixedTrustManagerFactoryProvider();
4036

4137
private FixedTrustManagerFactory(FixedTrustManagersSpi spi, String algorithm) {
4238
super(spi, PROVIDER, algorithm);
@@ -70,4 +66,12 @@ protected TrustManager[] engineGetTrustManagers() {
7066

7167
}
7268

69+
private static class FixedTrustManagerFactoryProvider extends Provider {
70+
71+
FixedTrustManagerFactoryProvider() {
72+
super("FixedTrustManagerFactory", SpringBootProviderVersion.get(), "");
73+
}
74+
75+
}
76+
7377
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2012-present 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+
17+
package org.springframework.boot.ssl;
18+
19+
/**
20+
* Exposes the Spring Boot version for SSL Provider use.
21+
*
22+
* @author Phillip Webb
23+
*/
24+
final class SpringBootProviderVersion {
25+
26+
private SpringBootProviderVersion() {
27+
}
28+
29+
/**
30+
* Return the full version string of the present Spring Boot codebase.
31+
* @return the version of Spring Boot
32+
*/
33+
static String get() {
34+
return "${springBootVersion}";
35+
}
36+
37+
}

0 commit comments

Comments
 (0)