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.
This commit is contained in:
Robert Miles 2020-11-28 10:07:27 +00:00
parent 48f9a206c0
commit 06ae7c0442
1 changed files with 2 additions and 0 deletions

View File

@ -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
}