From 472d0e8544b2fa3c4b954906c657d80493e83f1f Mon Sep 17 00:00:00 2001 From: Hugo Gonzalez Date: Thu, 14 Nov 2024 15:16:58 +0100 Subject: [PATCH] avoid panic when parsing x509 cert --- utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.go b/utils.go index cb93cf2..9d87665 100644 --- a/utils.go +++ b/utils.go @@ -14,7 +14,7 @@ import ( "io" "io/ioutil" "log" - "net" + "net" "net/http" "net/url" "os" @@ -459,6 +459,7 @@ func getUserData(r *http.Request) map[string]interface{} { cert, err := x509.ParseCertificate(asn1Data.Raw) if err != nil { log.Println("x509RequestHandler tls: failed to parse certificate from server: " + err.Error()) + continue } if len(cert.UnhandledCriticalExtensions) > 0 { if Config.Verbose > 2 { @@ -672,4 +673,3 @@ func debugHandler(w http.ResponseWriter, r *http.Request) { // Serve the original debug endpoint if the IP is allowed http.DefaultServeMux.ServeHTTP(w, r) } -