Skip to content

Commit

Permalink
Change verbosity level
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jun 17, 2024
1 parent 1551505 commit e27993d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,13 @@ func findCN(subject string) (string, error) {
func getUserData(r *http.Request) map[string]interface{} {
userData := make(map[string]interface{})
if r.TLS == nil {
if Config.Verbose > 0 {
if Config.Verbose > 2 {
log.Printf("HTTP request does not support TLS, %+v", r)
}
return userData
}
certs := r.TLS.PeerCertificates
if Config.Verbose > 0 {
if Config.Verbose > 2 {
log.Printf("found %d peer certificates in HTTP request", len(certs))
log.Printf("HTTP request %+v", r)
log.Printf("HTTP request TLS %+v", r.TLS)
Expand All @@ -328,7 +328,7 @@ func getUserData(r *http.Request) map[string]interface{} {
log.Println("x509RequestHandler tls: failed to parse certificate from server: " + err.Error())
}
if len(cert.UnhandledCriticalExtensions) > 0 {
if Config.Verbose > 0 {
if Config.Verbose > 2 {
log.Println("cert.UnhandledCriticalExtensions equal to", len(cert.UnhandledCriticalExtensions))
}
continue
Expand All @@ -344,11 +344,11 @@ func getUserData(r *http.Request) map[string]interface{} {
}
subjects = append(subjects, s)
}
if Config.Verbose > 0 {
if Config.Verbose > 2 {
log.Println("cert subjects", subjects)
}
rec, err := cric.FindUser(subjects)
if Config.Verbose > 0 {
if Config.Verbose > 1 {
log.Printf("found user %+v error=%v elapsed time %v\n", rec, err, time.Since(start))
}
if err == nil {
Expand Down

0 comments on commit e27993d

Please sign in to comment.