Skip to content

Commit 72df5fe

Browse files
Add docs
1 parent 63d4496 commit 72df5fe

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/ssl/SslHealthIndicatorProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class SslHealthIndicatorProperties {
3232

3333
/**
34-
* If the certificate will be invalid within the time span defined by this threshold,
34+
* If an SSL Certificate will be invalid within the time span defined by this threshold,
3535
* it should trigger a warning.
3636
*/
3737
private Duration certificateValidityWarningThreshold = Duration.ofDays(14);

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/ssl/SslHealthIndicator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ protected void doHealthCheck(Builder builder) throws Exception {
6868
builder.status(Status.OUT_OF_SERVICE);
6969
}
7070
else if (statuses.contains(Validity.Status.WILL_EXPIRE_SOON)) {
71-
// TODO: Should we introduce Status.WARNING
72-
// (returns 200 but indicates that something is not right)?
7371
builder.status(WILL_EXPIRE_SOON_STATUS);
7472
}
7573
else {

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/endpoints.adoc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,10 +648,18 @@ with the `key` listed in the following table:
648648
| `redis`
649649
| javadoc:org.springframework.boot.actuate.data.redis.RedisHealthIndicator[]
650650
| Checks that a Redis server is up.
651+
652+
| `ssl`
653+
| javadoc:org.springframework.boot.actuate.ssl.SslHealthIndicator[]
654+
| Checks that SSL Cerificates are ok.
651655
|===
652656

653657
TIP: You can disable them all by setting the configprop:management.health.defaults.enabled[] property.
654658

659+
TIP: The `ssl` `HealthIndicator` has a "warning threshold" property. If an SSL Certificate will be invalid within the time span defined by this threshold, the `HealthIndicator` will warn you but it will still return HTTP 200 to not disrupt the application. You can use this threshold to give yourself enough lead time to rotate the soon to be expired certificate. See the `management.health.ssl.certificate-validity-warning-threshold` property.
660+
661+
662+
655663
Additional `HealthIndicators` are available but are not enabled by default:
656664

657665
[cols="3,4,6"]
@@ -1110,12 +1118,17 @@ When appropriate, Spring auto-configures the following `InfoContributor` beans:
11101118
| Exposes process information.
11111119
| None.
11121120

1121+
| `ssl`
1122+
| javadoc:org.springframework.boot.actuate.info.SslInfoContributor[]
1123+
| Exposes SSL Certificate information.
1124+
| An xref:features/ssl.adoc#features.ssl.bundles[SSL Bundle] configured.
1125+
11131126
|===
11141127

11151128
Whether an individual contributor is enabled is controlled by its `management.info.<id>.enabled` property.
11161129
Different contributors have different defaults for this property, depending on their prerequisites and the nature of the information that they expose.
11171130

1118-
With no prerequisites to indicate that they should be enabled, the `env`, `java`, `os`, and `process` contributors are disabled by default.
1131+
With no prerequisites to indicate that they should be enabled, the `env`, `java`, `os`, and `process` contributors are disabled by default. The `ssl` contributor has a prerequisite of having an xref:features/ssl.adoc#features.ssl.bundles[SSL Bundle] configured but it is disabled by default.
11191132
Each can be enabled by setting its `management.info.<id>.enabled` property to `true`.
11201133

11211134
The `build` and `git` info contributors are enabled by default.
@@ -1225,6 +1238,13 @@ The `info` endpoint publishes information about your process, see javadoc:org.sp
12251238

12261239

12271240

1241+
[[actuator.endpoints.info.ssl-information]]
1242+
=== SSL Information
1243+
1244+
The `info` endpoint publishes information about your SSL Certificates (that are configured through xref:features/ssl.adoc#features.ssl.bundles[SSL Bundles]), see javadoc:org.springframework.boot.info.SslInfo[] for more details. This endpoint reuses the "warning threshold" property of javadoc:org.springframework.boot.actuate.ssl.SslHealthIndicator[]: if an SSL Certificate will be invalid within the time span defined by this threshold, it will trigger a warning. See the `management.health.ssl.certificate-validity-warning-threshold` property.
1245+
1246+
1247+
12281248
[[actuator.endpoints.info.writing-custom-info-contributors]]
12291249
=== Writing Custom InfoContributors
12301250

0 commit comments

Comments
 (0)