From dcf5c646be66b9882335f1780313aa7775e46100 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Fri, 16 Feb 2018 09:05:11 -0500 Subject: [PATCH] Use correct X509 certificate attribute name Issue: SPR-16507 --- .../http/server/reactive/ServletServerHttpRequest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpRequest.java b/spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpRequest.java index df2d5f753f..726bbc33e6 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpRequest.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpRequest.java @@ -56,6 +56,11 @@ import org.springframework.util.StringUtils; */ class ServletServerHttpRequest extends AbstractServerHttpRequest { + private static final String X509_CERTIFICATE_ATTRIBUTE = "javax.servlet.request.X509Certificate"; + + private static final String SSL_SESSION_ID_ATTRIBUTE = "javax.servlet.request.ssl_session_id"; + + protected final Log logger = LogFactory.getLog(getClass()); @@ -178,8 +183,8 @@ class ServletServerHttpRequest extends AbstractServerHttpRequest { return null; } return new DefaultSslInfo( - (String) request.getAttribute("javax.servlet.request.ssl_session_id"), - (X509Certificate[]) request.getAttribute("java.security.cert.X509Certificate")); + (String) request.getAttribute(SSL_SESSION_ID_ATTRIBUTE), + (X509Certificate[]) request.getAttribute(X509_CERTIFICATE_ATTRIBUTE)); } @Override