mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-12-03 15:18:39 +00:00
Fix public key verification with empty certificate chain
This commit is contained in:
@@ -276,6 +276,9 @@ func verifyConnection(rootCAs *x509.CertPool, timeFunc func() time.Time, serverN
|
||||
}
|
||||
|
||||
func VerifyPublicKeySHA256(knownHashValues [][]byte, rawCerts [][]byte) error {
|
||||
if len(rawCerts) == 0 {
|
||||
return E.New("missing remote certificate")
|
||||
}
|
||||
leafCertificate, err := x509.ParseCertificate(rawCerts[0])
|
||||
if err != nil {
|
||||
return E.Cause(err, "failed to parse leaf certificate")
|
||||
|
||||
Reference in New Issue
Block a user