diff --git a/gennghttpxfun.py b/gennghttpxfun.py index bd7ccd9f..b42bd248 100755 --- a/gennghttpxfun.py +++ b/gennghttpxfun.py @@ -184,6 +184,10 @@ LOGVARS = [ "ssl_protocol", "ssl_session_id", "ssl_session_reused", + "tls_cipher", + "tls_protocol", + "tls_session_id", + "tls_session_reused", "backend_host", "backend_port", ] diff --git a/src/shrpx.cc b/src/shrpx.cc index 7601f1f3..4c4ab9ac 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -2447,10 +2447,10 @@ Logging: * $alpn: ALPN identifier of the protocol which generates the response. For HTTP/1, ALPN is always http/1.1, regardless of minor version. - * $ssl_cipher: cipher used for SSL/TLS connection. - * $ssl_protocol: protocol for SSL/TLS connection. - * $ssl_session_id: session ID for SSL/TLS connection. - * $ssl_session_reused: "r" if SSL/TLS session was + * $tls_cipher: cipher used for SSL/TLS connection. + * $tls_protocol: protocol for SSL/TLS connection. + * $tls_session_id: session ID for SSL/TLS connection. + * $tls_session_reused: "r" if SSL/TLS session was reused. Otherwise, "." * $backend_host: backend host used to fulfill the request. "-" if backend host is not available. diff --git a/src/shrpx_config.cc b/src/shrpx_config.cc index 34f6cc06..997b0ee5 100644 --- a/src/shrpx_config.cc +++ b/src/shrpx_config.cc @@ -419,6 +419,9 @@ LogFragmentType log_var_lookup_token(const char *name, size_t namelen) { if (util::strieq_l("ssl_ciphe", name, 9)) { return SHRPX_LOGF_SSL_CIPHER; } + if (util::strieq_l("tls_ciphe", name, 9)) { + return SHRPX_LOGF_TLS_CIPHER; + } break; } break; @@ -455,6 +458,9 @@ LogFragmentType log_var_lookup_token(const char *name, size_t namelen) { if (util::strieq_l("ssl_protoco", name, 11)) { return SHRPX_LOGF_SSL_PROTOCOL; } + if (util::strieq_l("tls_protoco", name, 11)) { + return SHRPX_LOGF_TLS_PROTOCOL; + } break; case 't': if (util::strieq_l("backend_hos", name, 11)) { @@ -472,6 +478,9 @@ LogFragmentType log_var_lookup_token(const char *name, size_t namelen) { if (util::strieq_l("ssl_session_i", name, 13)) { return SHRPX_LOGF_SSL_SESSION_ID; } + if (util::strieq_l("tls_session_i", name, 13)) { + return SHRPX_LOGF_TLS_SESSION_ID; + } break; } break; @@ -490,6 +499,9 @@ LogFragmentType log_var_lookup_token(const char *name, size_t namelen) { if (util::strieq_l("ssl_session_reuse", name, 17)) { return SHRPX_LOGF_SSL_SESSION_REUSED; } + if (util::strieq_l("tls_session_reuse", name, 17)) { + return SHRPX_LOGF_TLS_SESSION_REUSED; + } break; } break; diff --git a/src/shrpx_log.h b/src/shrpx_log.h index 61abb9e2..22cc153c 100644 --- a/src/shrpx_log.h +++ b/src/shrpx_log.h @@ -129,10 +129,14 @@ enum LogFragmentType { SHRPX_LOGF_REQUEST_TIME, SHRPX_LOGF_PID, SHRPX_LOGF_ALPN, - SHRPX_LOGF_SSL_CIPHER, - SHRPX_LOGF_SSL_PROTOCOL, - SHRPX_LOGF_SSL_SESSION_ID, - SHRPX_LOGF_SSL_SESSION_REUSED, + SHRPX_LOGF_TLS_CIPHER, + SHRPX_LOGF_SSL_CIPHER = SHRPX_LOGF_TLS_CIPHER, + SHRPX_LOGF_TLS_PROTOCOL, + SHRPX_LOGF_SSL_PROTOCOL = SHRPX_LOGF_TLS_PROTOCOL, + SHRPX_LOGF_TLS_SESSION_ID, + SHRPX_LOGF_SSL_SESSION_ID = SHRPX_LOGF_TLS_SESSION_ID, + SHRPX_LOGF_TLS_SESSION_REUSED, + SHRPX_LOGF_SSL_SESSION_REUSED = SHRPX_LOGF_TLS_SESSION_REUSED, SHRPX_LOGF_BACKEND_HOST, SHRPX_LOGF_BACKEND_PORT, };