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

markt-asf 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 eb875e7795 Improve docs for scheme and secure on Connector
eb875e7795 is described below

commit eb875e77959eaa70d480e73ead4d02cf6cfe6744
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Jun 4 15:56:54 2026 +0100

    Improve docs for scheme and secure on Connector
---
 .../apache/catalina/connector/CoyoteAdapter.java   |  5 +++--
 webapps/docs/changelog.xml                         |  6 ++++-
 webapps/docs/config/ajp.xml                        | 26 +++++++++++++---------
 webapps/docs/config/http.xml                       | 26 +++++++++++++---------
 4 files changed, 40 insertions(+), 23 deletions(-)

diff --git a/java/org/apache/catalina/connector/CoyoteAdapter.java 
b/java/org/apache/catalina/connector/CoyoteAdapter.java
index ddfbe76c52..2775e3cdfb 100644
--- a/java/org/apache/catalina/connector/CoyoteAdapter.java
+++ b/java/org/apache/catalina/connector/CoyoteAdapter.java
@@ -567,8 +567,9 @@ public class CoyoteAdapter implements Adapter {
             Response response) throws IOException, ServletException {
 
         /*
-         * If the processor has set the scheme (AJP and HTTP/2 do this, 
HTTP/1.x does this if SSL is enabled), use this
-         * to set the secure flag as well. If the processor hasn't set it, use 
the settings from the connector.
+         * If the processor has set the scheme (HTTP/2 does this, AJP does 
this if is_ssl is set and HTTP/1.x does this
+         * if SSL is enabled), use this to set the secure flag as well. If the 
processor hasn't set it, use the settings
+         * from the connector.
          */
         if (req.scheme().isNull()) {
             // Use connector scheme and secure configuration, (defaults to
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 546c1e2d3c..bd4bdece3a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -347,9 +347,13 @@
         manager servlet. (remm)
       </fix>
       <fix>
-        Manager. Ensure automatic deployment does not trigger an undeployment
+        Manager: Ensure automatic deployment does not trigger an undeployment
         during a Manager triggered web application reload. (markt)
       </fix>
+      <fix>
+        Documentation: Provide better documentation for the <code>scheme</code>
+        and <code>secure</code> attributes of a Connector. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">
diff --git a/webapps/docs/config/ajp.xml b/webapps/docs/config/ajp.xml
index feaae6db19..dc6aadf448 100644
--- a/webapps/docs/config/ajp.xml
+++ b/webapps/docs/config/ajp.xml
@@ -308,20 +308,26 @@
     </attribute>
 
     <attribute name="scheme" required="false">
-      <p>Set this attribute to the name of the protocol you wish to have
-      returned by calls to <code>request.getScheme()</code>.  For
-      example, you would set this attribute to "<code>https</code>"
-      for an SSL Connector.  The default value is "<code>http</code>".
+      <p>Ignored if the <code>is_ssl</code> attribute is set in the
+      <code>AJP13_FORWARD_REQUEST</code> message. If <code>is_ssl</code> is 
set,
+      scheme is always set to <code>https</code>.
+      </p>
+      <p>Otherwise, set this attribute to the name of the protocol you wish to
+      have returned by calls to <code>request.getScheme()</code>. The default
+      value is <code>http</code>.
       </p>
     </attribute>
 
     <attribute name="secure" required="false">
-      <p>Set this attribute to <code>true</code> if you wish to have
-      calls to <code>request.isSecure()</code> to return <code>true</code>
-      for requests received by this Connector. You would want this on an
-      SSL Connector or a non SSL connector that is receiving data from a
-      SSL accelerator, like a crypto card, an SSL appliance or even a 
webserver.
-      The default value is <code>false</code>.</p>
+      <p>Ignored if the <code>is_ssl</code> attribute is set in the
+      <code>AJP13_FORWARD_REQUEST</code> message. If <code>is_ssl</code> is 
set,
+      secure is always set to <code>true</code>.
+      </p>
+      <p>Otherwise, set this attribute to <code>true</code> if you wish to have
+      calls to <code>request.isSecure()</code> to return <code>true</code> for
+      requests received by this Connector. The default value is
+      <code>false</code>.
+      </p>
     </attribute>
 
     <attribute name="URIEncoding" required="false">
diff --git a/webapps/docs/config/http.xml b/webapps/docs/config/http.xml
index c72e0d77cc..7523e3b848 100644
--- a/webapps/docs/config/http.xml
+++ b/webapps/docs/config/http.xml
@@ -311,20 +311,26 @@
     </attribute>
 
     <attribute name="scheme" required="false">
-      <p>Set this attribute to the name of the protocol you wish to have
-      returned by calls to <code>request.getScheme()</code>.  For
-      example, you would set this attribute to "<code>https</code>"
-      for an SSL Connector.  The default value is "<code>http</code>".
+      <p>Ignored if <code>SSLEnabled</code> is <code>true</code>. If
+      <code>SSLEnabled</code> is set, scheme is always set to
+      <code>https</code>.
+      </p>
+      <p>Otherwise, set this attribute to the name of the protocol you wish to
+      have returned by calls to <code>request.getScheme()</code>. The default
+      value is <code>http</code>.
       </p>
     </attribute>
 
     <attribute name="secure" required="false">
-      <p>Set this attribute to <code>true</code> if you wish to have
-      calls to <code>request.isSecure()</code> to return <code>true</code>
-      for requests received by this Connector. You would want this on an
-      SSL Connector or a non SSL connector that is receiving data from a
-      SSL accelerator, like a crypto card, an SSL appliance or even a 
webserver.
-      The default value is <code>false</code>.</p>
+      <p>Ignored if <code>SSLEnabled</code> is <code>true</code>. If
+      <code>SSLEnabled</code> is set, secure is always set to
+      <code>true</code>.
+      </p>
+      <p>Otherwise, set this attribute to <code>true</code> if you wish to have
+      calls to <code>request.isSecure()</code> to return <code>true</code> for
+      requests received by this Connector. The default value is
+      <code>false</code>.
+      </p>
     </attribute>
 
     <attribute name="strictSni" required="false">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to