You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/02/26 12:39:32 UTC

[tomcat] branch 9.0.x updated: Fix AJP Connector when requests forwarded from IIS originally use TLS

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new e305e62  Fix AJP Connector when requests forwarded from IIS originally use TLS
e305e62 is described below

commit e305e62769ecc431f2a5cceb5e2fece4359b61a7
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Feb 26 12:34:11 2020 +0000

    Fix AJP Connector when requests forwarded from IIS originally use TLS
    
    Add the TLS request attributes used by IIS to the attributes that an AJP
    Connector will always accept.
---
 java/org/apache/coyote/ajp/AjpProcessor.java | 16 ++++++++++++++++
 webapps/docs/changelog.xml                   |  4 ++++
 webapps/docs/config/ajp.xml                  |  9 +++++++++
 3 files changed, 29 insertions(+)

diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java
index 04e5a69..7bbdf0a 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -84,6 +84,7 @@ public class AjpProcessor extends AbstractProcessor {
 
 
     private static final Set<String> javaxAttributes;
+    private static final Set<String> iisTlsAttributes;
 
 
     static {
@@ -134,6 +135,18 @@ public class AjpProcessor extends AbstractProcessor {
         s.add("javax.servlet.request.ssl_session");
         s.add("javax.servlet.request.X509Certificate");
         javaxAttributes= Collections.unmodifiableSet(s);
+
+        Set<String> iis = new HashSet<>();
+        iis.add("CERT_ISSUER");
+        iis.add("CERT_SUBJECT");
+        iis.add("CERT_COOKIE");
+        iis.add("HTTPS_SERVER_SUBJECT");
+        iis.add("CERT_FLAGS");
+        iis.add("HTTPS_SECRETKEYSIZE");
+        iis.add("CERT_SERIALNUMBER");
+        iis.add("HTTPS_SERVER_ISSUER");
+        iis.add("HTTPS_KEYSIZE");
+        iisTlsAttributes = Collections.unmodifiableSet(iis);
     }
 
 
@@ -748,6 +761,9 @@ public class AjpProcessor extends AbstractProcessor {
                     request.setAttribute(n, v);
                 } else if (javaxAttributes.contains(n)) {
                     request.setAttribute(n, v);
+                } else if (iisTlsAttributes.contains(n)) {
+                    // Allow IIS TLS attributes
+                    request.setAttribute(n, v);
                 } else {
                     // All 'known' attributes will be processed by the previous
                     // blocks. Any remaining attribute is an 'arbitrary' one.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 1c9ad17..6c9b1ad 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -86,6 +86,10 @@
         Improve robustness of OpenSSLEngine shutdown. Based on code submitted
         by Manuel Dominguez Sarmiento. (remm)
       </fix>
+      <fix>
+        Add the TLS request attributes used by IIS to the attributes that an AJP
+        Connector will always accept. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">
diff --git a/webapps/docs/config/ajp.xml b/webapps/docs/config/ajp.xml
index 9760e80..12b554d 100644
--- a/webapps/docs/config/ajp.xml
+++ b/webapps/docs/config/ajp.xml
@@ -330,6 +330,15 @@
         <li>AJP_REMOTE_PORT</li>
         <li>AJP_SSL_PROTOCOL</li>
         <li>JK_LB_ACTIVATION</li>
+        <li>CERT_ISSUER (IIS only)</li>
+        <li>CERT_SUBJECT (IIS only)</li>
+        <li>CERT_COOKIE (IIS only)</li>
+        <li>HTTPS_SERVER_SUBJECT (IIS only)</li>
+        <li>CERT_FLAGS (IIS only)</li>
+        <li>HTTPS_SECRETKEYSIZE (IIS only)</li>
+        <li>CERT_SERIALNUMBER (IIS only)</li>
+        <li>HTTPS_SERVER_ISSUER (IIS only)</li>
+        <li>HTTPS_KEYSIZE (IIS only)</li>
       </ul>
       <p>The AJP protocol supports the passing of arbitrary request attributes.
       Requests containing arbitrary request attributes will be rejected with a


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org