576df0
diff --git a/modules/proxy/ajp.h b/modules/proxy/ajp.h
576df0
index c119a7e..267150a 100644
576df0
--- a/modules/proxy/ajp.h
576df0
+++ b/modules/proxy/ajp.h
576df0
@@ -413,12 +413,14 @@ apr_status_t ajp_ilink_receive(apr_socket_t *sock, ajp_msg_t *msg);
576df0
  * @param sock      backend socket
576df0
  * @param r         current request
576df0
  * @param buffsize  max size of the AJP packet.
576df0
+ * @param secret    authentication secret
576df0
  * @param uri       requested uri
576df0
  * @return          APR_SUCCESS or error
576df0
  */
576df0
 apr_status_t ajp_send_header(apr_socket_t *sock, request_rec *r,
576df0
                              apr_size_t buffsize,
576df0
-                             apr_uri_t *uri);
576df0
+                             apr_uri_t *uri,
576df0
+                             const char *secret);
576df0
 
576df0
 /**
576df0
  * Read the ajp message and return the type of the message.
576df0
diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c
576df0
index 67353a7..680a8f3 100644
576df0
--- a/modules/proxy/ajp_header.c
576df0
+++ b/modules/proxy/ajp_header.c
576df0
@@ -213,7 +213,8 @@ AJPV13_REQUEST/AJPV14_REQUEST=
576df0
 
576df0
 static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
576df0
                                           request_rec *r,
576df0
-                                          apr_uri_t *uri)
576df0
+                                          apr_uri_t *uri,
576df0
+                                          const char *secret)
576df0
 {
576df0
     int method;
576df0
     apr_uint32_t i, num_headers = 0;
576df0
@@ -293,17 +294,15 @@ static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg,
576df0
                    i, elts[i].key, elts[i].val);
576df0
     }
576df0
 
576df0
-/* XXXX need to figure out how to do this
576df0
-    if (s->secret) {
576df0
+    if (secret) {
576df0
         if (ajp_msg_append_uint8(msg, SC_A_SECRET) ||
576df0
-            ajp_msg_append_string(msg, s->secret)) {
576df0
+            ajp_msg_append_string(msg, secret)) {
576df0
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(03228)
576df0
-                   "Error ajp_marshal_into_msgb - "
576df0
+                   "ajp_marshal_into_msgb: "
576df0
                    "Error appending secret");
576df0
             return APR_EGENERAL;
576df0
         }
576df0
     }
576df0
- */
576df0
 
576df0
     if (r->user) {
576df0
         if (ajp_msg_append_uint8(msg, SC_A_REMOTE_USER) ||
576df0
@@ -671,7 +670,8 @@ static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg,
576df0
 apr_status_t ajp_send_header(apr_socket_t *sock,
576df0
                              request_rec *r,
576df0
                              apr_size_t buffsize,
576df0
-                             apr_uri_t *uri)
576df0
+                             apr_uri_t *uri,
576df0
+                             const char *secret)
576df0
 {
576df0
     ajp_msg_t *msg;
576df0
     apr_status_t rc;
576df0
@@ -683,7 +683,7 @@ apr_status_t ajp_send_header(apr_socket_t *sock,
576df0
         return rc;
576df0
     }
576df0
 
576df0
-    rc = ajp_marshal_into_msgb(msg, r, uri);
576df0
+    rc = ajp_marshal_into_msgb(msg, r, uri, secret);
576df0
     if (rc != APR_SUCCESS) {
576df0
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00988)
576df0
                "ajp_send_header: ajp_marshal_into_msgb failed");
576df0
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
576df0
index 69a35ce..800ede1 100644
576df0
--- a/modules/proxy/mod_proxy.c
576df0
+++ b/modules/proxy/mod_proxy.c
576df0
@@ -327,6 +327,12 @@ static const char *set_worker_param(apr_pool_t *p,
576df0
         worker->s->response_field_size = (s ? s : HUGE_STRING_LEN);
576df0
         worker->s->response_field_size_set = 1;
576df0
     }
576df0
+    else if (!strcasecmp(key, "secret")) {
576df0
+        if (PROXY_STRNCPY(worker->s->secret, val) != APR_SUCCESS) {
576df0
+            return apr_psprintf(p, "Secret length must be < %d characters",
576df0
+                                (int)sizeof(worker->s->secret));
576df0
+        }
576df0
+    }
576df0
     else {
576df0
         if (set_worker_hc_param_f) {
576df0
             return set_worker_hc_param_f(p, s, worker, key, val, NULL);
576df0
diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h
576df0
index aabd09f..3419023 100644
576df0
--- a/modules/proxy/mod_proxy.h
576df0
+++ b/modules/proxy/mod_proxy.h
576df0
@@ -357,6 +357,7 @@ PROXY_WORKER_HC_FAIL )
576df0
 #define PROXY_WORKER_MAX_HOSTNAME_SIZE  64
576df0
 #define PROXY_BALANCER_MAX_HOSTNAME_SIZE PROXY_WORKER_MAX_HOSTNAME_SIZE
576df0
 #define PROXY_BALANCER_MAX_STICKY_SIZE  64
576df0
+#define PROXY_WORKER_MAX_SECRET_SIZE    64
576df0
 
576df0
 #define PROXY_RFC1035_HOSTNAME_SIZE	256
576df0
 
576df0
@@ -450,6 +451,7 @@ typedef struct {
576df0
     hcmethod_t      method;     /* method to use for health check */
576df0
     apr_interval_time_t interval;
576df0
     char      upgrade[PROXY_WORKER_MAX_SCHEME_SIZE];/* upgrade protocol used by mod_proxy_wstunnel */
576df0
+    char      secret[PROXY_WORKER_MAX_SECRET_SIZE]; /* authentication secret (e.g. AJP13) */
576df0
     char      hostname_ex[PROXY_RFC1035_HOSTNAME_SIZE];  /* RFC1035 compliant version of the remote backend address */
576df0
     apr_size_t   response_field_size; /* Size of proxy response buffer in bytes. */
576df0
     unsigned int response_field_size_set:1;
576df0
diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c
576df0
index 73716af..6faabea 100644
576df0
--- a/modules/proxy/mod_proxy_ajp.c
576df0
+++ b/modules/proxy/mod_proxy_ajp.c
576df0
@@ -193,6 +193,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
576df0
     apr_off_t content_length = 0;
576df0
     int original_status = r->status;
576df0
     const char *original_status_line = r->status_line;
576df0
+    const char *secret = NULL;
576df0
 
576df0
     if (psf->io_buffer_size_set)
576df0
        maxsize = psf->io_buffer_size;
576df0
@@ -202,12 +203,15 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
576df0
        maxsize = AJP_MSG_BUFFER_SZ;
576df0
     maxsize = APR_ALIGN(maxsize, 1024);
576df0
 
576df0
+    if (*conn->worker->s->secret)
576df0
+        secret = conn->worker->s->secret;
576df0
+
576df0
     /*
576df0
      * Send the AJP request to the remote server
576df0
      */
576df0
 
576df0
     /* send request headers */
576df0
-    status = ajp_send_header(conn->sock, r, maxsize, uri);
576df0
+    status = ajp_send_header(conn->sock, r, maxsize, uri, secret);
576df0
     if (status != APR_SUCCESS) {
576df0
         conn->close = 1;
576df0
         ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, APLOGNO(00868)