Clash.Meta/component/ca/fix_windows.go

15 lines
422 B
Go
Raw Normal View History

2024-05-12 12:36:48 +08:00
package ca
import (
"github.com/metacubex/mihomo/constant/features"
2024-05-12 12:36:48 +08:00
)
func init() {
// 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 features.WindowsMajorVersion < 10 && len(_CaCertificates) > 0 {
2024-05-12 12:36:48 +08:00
DisableSystemCa = true
}
}