Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SslHealthIndicator throws NullPointerException when using SslBundle with SslStoreBundle.NONE #43078

Closed
matthew-js-porter opened this issue Nov 8, 2024 · 2 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@matthew-js-porter
Copy link

SslHealthIndicator throws NullPointerException when using SslBundle with SslStoreBundle.NONE.

Stacktrace

java.lang.NullPointerException: Cannot invoke "java.security.KeyStore.aliases()" because "keyStore" is null
	at org.springframework.boot.info.SslInfo$BundleInfo.extractCertificateChains(SslInfo.java:80) ~[spring-boot-3.4.0-RC1.jar:3.4.0-RC1]
	at org.springframework.boot.info.SslInfo$BundleInfo.<init>(SslInfo.java:75) ~[spring-boot-3.4.0-RC1.jar:3.4.0-RC1]
	at org.springframework.boot.info.SslInfo.lambda$getBundles$0(SslInfo.java:60) ~[spring-boot-3.4.0-RC1.jar:3.4.0-RC1]
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575) ~[na:na]
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622) ~[na:na]
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627) ~[na:na]
	at org.springframework.boot.info.SslInfo.getBundles(SslInfo.java:61) ~[spring-boot-3.4.0-RC1.jar:3.4.0-RC1]
	at org.springframework.boot.actuate.ssl.SslHealthIndicator.doHealthCheck(SslHealthIndicator.java:51) ~[spring-boot-actuator-3.4.0-RC1.jar:3.4.0-RC1]

Steps to Reproduce

  1. Create a project with spring-boot-starter-web and spring-boot-starter-actuator
  2. Register an SslBundle using SslStoreBundle.NONE
@Bean
public SslBundleRegistrar registrar() {
	final String[] ciphers = new String[] {
		"TLS_AES_256_GCM_SHA384"
	};
	final String[] protocols = new String[] {
			"TLSv1.2"
	};
	return registry -> registry.registerBundle("sample", SslBundle.of(SslStoreBundle.NONE,
			SslBundleKey.NONE, SslOptions.of(ciphers, protocols)));
}
  1. Observe error in logs and at /actuator/health endpoint.

This was observed using Spring Boot 3.4.0-RC1

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 8, 2024
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 9, 2024
@philwebb philwebb added this to the 3.4.0 milestone Nov 9, 2024
@philwebb philwebb self-assigned this Nov 9, 2024
@philwebb
Copy link
Member

philwebb commented Nov 9, 2024

Thanks for trying the RC and reporting the issue.

@matthew-js-porter
Copy link
Author

@philwebb Thank You for looking at these so quickly and the hard work you all put into making the Spring ecosystem so great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants