Skip to content

"Want" two-way-ssl not containing SSL-Certificate is not checkable due to contract violation [SPR-16842] #21382

@spring-projects-issues

Description

@spring-projects-issues

Henning Vogt opened SPR-16842 and commented

Hi,
If two-way-ssl is on "want" mode (as opposed to the stricter "need"), and client does not deliver a certificate, getSslInfo() does not work, since init method fails:

java.lang.IllegalArgumentException: No SSL certificates
	at org.springframework.util.Assert.notNull(Assert.java:193)
	at org.springframework.http.server.reactive.DefaultSslInfo.<init>(DefaultSslInfo.java:44)
	at org.springframework.http.server.reactive.ServletServerHttpRequest.initSslInfo(ServletServerHttpRequest.java:190)
	at org.springframework.http.server.reactive.AbstractServerHttpRequest.getSslInfo(AbstractServerHttpRequest.java:162)

...but according to the description, it's supposed to work:

/**
 * Return the SSL session information if the request has been transmitted
 * over a secure protocol including SSL certificates, if available.
 * @return the session information, or \{@code null} if none available
 * @since 5.0.2 */
 @Nullable default SslInfo getSslInfo() \{ return null; }

 


Affects: 5.0.5

Issue Links:

Referenced from: commits 1e4a3a2, a158ff4

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions