Fix disable_sni not working with custom RootCAs

This commit is contained in:
dyhkwong
2025-07-21 19:22:43 +08:00
committed by 世界
parent e061538c30
commit 687343f6ca
2 changed files with 9 additions and 2 deletions

View File

@@ -86,6 +86,8 @@ func NewSTDClient(ctx context.Context, serverAddress string, options option.Outb
tlsConfig.InsecureSkipVerify = true
tlsConfig.VerifyConnection = func(state tls.ConnectionState) error {
verifyOptions := x509.VerifyOptions{
Roots: tlsConfig.RootCAs,
CurrentTime: tlsConfig.Time(),
DNSName: serverName,
Intermediates: x509.NewCertPool(),
}