Mutualize TLS version and cipher code
This commit is contained in:
parent
b05a5c818d
commit
4b370930b5
4 changed files with 27 additions and 41 deletions
|
@ -210,8 +210,8 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request, next http
|
|||
core[RequestScheme] = "http"
|
||||
if req.TLS != nil {
|
||||
core[RequestScheme] = "https"
|
||||
core[TLSVersion] = getRequestTLSVersion(req)
|
||||
core[TLSCipher] = getRequestTLSCipher(req)
|
||||
core[TLSVersion] = traefiktls.GetVersion(req.TLS)
|
||||
core[TLSCipher] = traefiktls.GetCipherName(req.TLS)
|
||||
}
|
||||
|
||||
core[ClientAddr] = req.RemoteAddr
|
||||
|
@ -385,19 +385,3 @@ var requestCounter uint64 // Request ID
|
|||
func nextRequestCount() uint64 {
|
||||
return atomic.AddUint64(&requestCounter, 1)
|
||||
}
|
||||
|
||||
func getRequestTLSVersion(req *http.Request) string {
|
||||
if version, ok := traefiktls.VersionsReversed[req.TLS.Version]; ok {
|
||||
return version
|
||||
}
|
||||
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
func getRequestTLSCipher(req *http.Request) string {
|
||||
if cypher, ok := traefiktls.CipherSuitesReversed[req.TLS.CipherSuite]; ok {
|
||||
return cypher
|
||||
}
|
||||
|
||||
return "unknown"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue