chore: swtich RtlGetNtVersionNumbers to RtlGetVersion

https://go-review.googlesource.com/c/go/+/571015
This commit is contained in:
wwqgtxx
2024-05-12 20:23:13 +08:00
parent 7df1c26942
commit a50339bd5f
4 changed files with 19 additions and 7 deletions

View File

@@ -1,15 +1,14 @@
package ca
import (
"golang.org/x/sys/windows"
"github.com/metacubex/mihomo/constant/features"
)
func init() {
majorVersion, _, _ := windows.RtlGetNtVersionNumbers()
// crypto/x509: certificate validation in Windows fails to validate IP in SAN
// https://github.com/golang/go/issues/37176
// As far as I can tell this is still the case on most older versions of Windows (but seems to be fixed in 10)
if majorVersion < 10 && len(_CaCertificates) > 0 {
if features.WindowsMajorVersion < 10 && len(_CaCertificates) > 0 {
DisableSystemCa = true
}
}