From 06ae7c04427220f19f18746aba8ba747fc95aab2 Mon Sep 17 00:00:00 2001 From: Robert Miles Date: Sat, 28 Nov 2020 10:07:27 +0000 Subject: [PATCH] Add "AUTH_TYPE" environment variable when client cert is present This makes it easier to detect when a client cert is available without having to look before you leap and attempt to access any of the TLS_* variables. --- dynamic.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dynamic.go b/dynamic.go index 02d38cf..ec5ecbc 100644 --- a/dynamic.go +++ b/dynamic.go @@ -189,6 +189,8 @@ func prepareGatewayVariables(config Config, URL *url.URL, conn net.Conn) map[str vars["TLS_CLIENT_ISSUER_CN"] = cert.Issuer.CommonName vars["TLS_CLIENT_SUBJECT"] = cert.Subject.String() vars["TLS_CLIENT_SUBJECT_CN"] = cert.Subject.CommonName + // To make it easier to detect when a cert is present + vars["AUTH_TYPE"] = "Certificate" } return vars }