Skip to content

Commit

Permalink
Merge pull request #35 from labkode/avoid_panic
Browse files Browse the repository at this point in the history
Avoid panic when parsing x509 cert
  • Loading branch information
vkuznet authored Nov 14, 2024
2 parents 38e23fa + 472d0e8 commit 10492b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"io"
"io/ioutil"
"log"
"net"
"net"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}

0 comments on commit 10492b5

Please sign in to comment.