tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lucas Ventura Carro <>
Subject Passing client certificate through Nginx to Tomcat SSL Valve
Date Thu, 23 Jun 2016 11:51:41 GMT
I have a webapp which reads a X.509 client certificate from the standard
servlet request attribute:
When Tomcat is the HTTPS endpoint, works like a charm.
But when there is a Nginx as the HTTPS endpoint, and Tomcat is configured
with HTTP, the certificate (of course) won't be at the attribute unless:
  - Configured Nginx to send it through a header, using its variable
'$ssl_client_cert' [1]
  - Added to Tomcat the SSL Valve [2] (same header as before).

But as a certificate in PEM format, it will contain new lines, and an HTTP
header can't be multilined (header-folding is deprecated [3]).

And here comes the incompatibility: Nginx replaces new lines with tab
characters, but the valve only try to change white spaces.
Should not be the SSL Valve smarter and try to replace one or multiple
whitespaces (the regex '\s+')? Or at least should be configurable the
delimiter character?



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message