Skip to content

IllegalArgumentException in SslServerCustomizer.loadStore if ssl.getKeystore() returns null #17051

@billore

Description

@billore

I have recently upgraded spring-boot from 2.0.8 to 2.1.4.
After upgrade, I have started seeing IllegalArgumentException in SslServerCustomizer.loadStore if ssl.getKeystore() returns null.

Looking at the code diff, in to older version(2.0.8) there was a null check for resource in the loadStore(), before calling into ResourceUtils.getURL(resource);

It looks like this null check is missing in the latest version and due to that, IllegalArgumentException is thrown at a later stage.
Due to this, my existing code has stopped working.

Caused by: java.lang.IllegalArgumentException: Resource location must not be null
	at org.springframework.util.Assert.notNull(Assert.java:198) ~[spring-core-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
	at org.springframework.util.ResourceUtils.getURL(ResourceUtils.java:130) ~[spring-core-5.1.6.RELEASE.jar!/:5.1.6.RELEASE]
	at org.springframework.boot.web.embedded.netty.SslServerCustomizer.loadStore(SslServerCustomizer.java:164) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
	at org.springframework.boot.web.embedded.netty.SslServerCustomizer.loadKeyStore(SslServerCustomizer.java:147) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
	at org.springframework.boot.web.embedded.netty.SslServerCustomizer.getKeyStore(SslServerCustomizer.java:117) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]
	at org.springframework.boot.web.embedded.netty.SslServerCustomizer.getKeyManagerFactory(SslServerCustomizer.java:96) ~[spring-boot-2.1.4.RELEASE.jar!/:2.1.4.RELEASE]

SslServerCustomizer diff 2 0 8 vs 2 1 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions