When https inspecting, log the request later on
authorFabian Keil <fk@fabiankeil.de>
Fri, 15 May 2020 18:08:19 +0000 (20:08 +0200)
committerFabian Keil <fk@fabiankeil.de>
Sat, 16 May 2020 09:10:49 +0000 (11:10 +0200)
... once we have gathered the path.

Include the protocol to differentiate the log messages from those
for plain http (which currently don't include the protocol).

Sponsored by: Robert Klemme

jcc.c

diff --git a/jcc.c b/jcc.c
index 56c617b..61426bc 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -2396,6 +2396,8 @@ static jb_err process_encrypted_request(struct client_state *csp)
 
    log_error(LOG_LEVEL_HEADER, "Encrypted request processed");
    log_applied_actions(csp->action);
+   log_error(LOG_LEVEL_GPC, "https://%s%s", csp->http->hostport,
+      csp->http->path);
 
    return err;
 
@@ -3635,8 +3637,17 @@ static void chat(struct client_state *csp)
    }
 
    log_applied_actions(csp->action);
-   log_error(LOG_LEVEL_GPC, "%s%s", http->hostport, http->path);
-
+#ifdef FEATURE_HTTPS_INSPECTION
+   /*
+    * Log the request unless we're https inspecting
+    * in which case we don't have the path yet and
+    * will log the request later.
+    */
+   if (!client_use_ssl(csp))
+#endif
+   {
+      log_error(LOG_LEVEL_GPC, "%s%s", http->hostport, http->path);
+   }
    if (fwd->forward_host)
    {
       log_error(LOG_LEVEL_CONNECT, "via [%s]:%d to: %s",