Go version
go version go1.26.2 windows/amd64
Output of go env in your module/workspace:
set AR=ar
set CC=gcc
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_ENABLED=0
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set CXX=g++
set GCCGO=gccgo
set GO111MODULE=
set GOAMD64=v1
set GOARCH=amd64
set GOAUTH=netrc
set GOBIN=
set GOCACHE=C:\Users\runneradmin\AppData\Local\go-build
set GOCACHEPROG=
set GODEBUG=
set GOENV=C:\Users\runneradmin\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFIPS140=off
set GOFLAGS=
set GOGCCFLAGS=-m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\RUNNER~1\AppData\Local\Temp\go-build3673626076=/tmp/go-build -gno-record-gcc-switches
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMOD=D:\a\mihomo\mihomo\go.mod
set GOMODCACHE=C:\Users\runneradmin\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\runneradmin\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\hostedtoolcache\windows\go-6d471830\1.26.2\x64
set GOSUMDB=sum.golang.org
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\runneradmin\AppData\Roaming\go\telemetry
set GOTMPDIR=
set GOTOOLCHAIN=local
set GOTOOLDIR=C:\hostedtoolcache\windows\go-6d471830\1.26.2\x64\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.26.2
set GOWORK=
set PKG_CONFIG=pkg-config
What did you do?
call crypto/x509.(*Certificate).Verify from tls stack‘s verifyServerCertificate
What did you see happen?
Exception 0xc0000005 0x1 0x48 0x7ffb9583adcb
PC=0x7ffb9583adcb
runtime.cgocall(0x7ff775de22a0, 0x199bba0c6b58)
runtime/cgocall.go:167 +0x3e fp=0x199bba430d60 sp=0x199bba430cf8 pc=0x7ff775e5347e
syscall.syscalln(0x0?, 0x0?, {0x199bba430dd8?, 0x7ff777e99840?, 0x199bba430d90?})
runtime/syscall_windows.go:431 +0x4e fp=0x199bba430d80 sp=0x199bba430d60 pc=0x7ff775e5a9ee
syscall.SyscallN(0x7ff777e99840?, {0x199bba430dd8?, 0x7ff775e1d100?, 0x199bba382960?})
syscall/dll_windows.go:99 +0x1e fp=0x199bba430db8 sp=0x199bba430d80 pc=0x7ff775e73a9e
syscall.CertFreeCertificateChain(0x199bba382960?)
syscall/zsyscall_windows.go:375 +0x5c fp=0x199bba430e00 sp=0x199bba430db8 pc=0x7ff775e7a7fc
crypto/x509.(*Certificate).systemVerify.deferwrap2()
crypto/x509/root_windows.go:254 +0x17 fp=0x199bba430e18 sp=0x199bba430e00 pc=0x7ff77601ce17
panic({0x7ff776dd2420?, 0x7ff777e7e700?})
runtime/panic.go:860 +0x13a fp=0x199bba430ec8 sp=0x199bba430e18 pc=0x7ff775e5649a
runtime.panicmem(...)
runtime/panic.go:336
runtime.sigpanic()
runtime/signal_windows.go:385 +0x198 fp=0x199bba430f10 sp=0x199bba430ec8 pc=0x7ff775e36d58
crypto/x509.checkChainTrustStatus(...)
crypto/x509/root_windows.go:95
crypto/x509.verifyChain(0x0?, 0x0, 0x1?)
crypto/x509/root_windows.go:164 +0x22 fp=0x199bba430fe0 sp=0x199bba430f10 pc=0x7ff77601c2c2
crypto/x509.(*Certificate).systemVerify(0x199bb9f9ac08, 0x199bba431330)
crypto/x509/root_windows.go:256 +0x405 fp=0x199bba431180 sp=0x199bba430fe0 pc=0x7ff77601c9c5
crypto/x509.(*Certificate).Verify(0x199bb9f9ac08, {{0x199bba13e8a0, 0x9}, 0x199bb9e68e70, 0x199bba1b0420, {0xc2771b4103392b5c, 0x3599f2c1, 0x7ff777ec6f20}, {0x0, 0x0, ...}, ...})
crypto/x509/verify.go:567 +0x1c6 fp=0x199bba431330 sp=0x199bba431180 pc=0x7ff77601f3e6
What did you expect to see?
The program should not crash.
The conditions for reproducing this issue are somewhat demanding. Specifically, on Windows 11 Pro (10.0.26200)/ Windows 11 LTSC (10.0.26100), when the network environment changes (i.e., the network port is disconnected or reconnected), there is a certain probability that this issue will be triggered when verifying the IP certificate.
We haven't found a sufficiently stable triggering method, but this issue has been reported by multiple different users, and the error messages are all the same.
Judging from the error message, the chainCtx passed to verifyChain is nil, which seems to be due to CertGetCertificateChain not handling the exception correctly.
Go version
go version go1.26.2 windows/amd64
Output of
go envin your module/workspace:What did you do?
call
crypto/x509.(*Certificate).Verifyfrom tls stack‘sverifyServerCertificateWhat did you see happen?
What did you expect to see?
The program should not crash.
The conditions for reproducing this issue are somewhat demanding. Specifically, on Windows 11 Pro (10.0.26200)/ Windows 11 LTSC (10.0.26100), when the network environment changes (i.e., the network port is disconnected or reconnected), there is a certain probability that this issue will be triggered when verifying the IP certificate.
We haven't found a sufficiently stable triggering method, but this issue has been reported by multiple different users, and the error messages are all the same.
Judging from the error message, the
chainCtxpassed toverifyChainis nil, which seems to be due toCertGetCertificateChainnot handling the exception correctly.