Compare commits

..

4 Commits

Author SHA1 Message Date
renovate[bot]
88c4122feb
[dependencies] Update golangci/golangci-lint-action action to v8 2025-07-24 01:23:33 +00:00
世界
9095e5763a
documentation: Bump version 2025-07-24 09:21:30 +08:00
世界
a11384b286
Fix time service wrapper 2025-07-24 09:21:08 +08:00
dyhkwong
9dd9fb27cd
Fix disable_sni nil time func 2025-07-24 09:21:08 +08:00
3 changed files with 10 additions and 5 deletions

View File

@ -87,13 +87,15 @@ func NewSTDClient(ctx context.Context, serverAddress string, options option.Outb
tlsConfig.VerifyConnection = func(state tls.ConnectionState) error { tlsConfig.VerifyConnection = func(state tls.ConnectionState) error {
verifyOptions := x509.VerifyOptions{ verifyOptions := x509.VerifyOptions{
Roots: tlsConfig.RootCAs, Roots: tlsConfig.RootCAs,
CurrentTime: tlsConfig.Time(),
DNSName: serverName, DNSName: serverName,
Intermediates: x509.NewCertPool(), Intermediates: x509.NewCertPool(),
} }
for _, cert := range state.PeerCertificates[1:] { for _, cert := range state.PeerCertificates[1:] {
verifyOptions.Intermediates.AddCert(cert) verifyOptions.Intermediates.AddCert(cert)
} }
if tlsConfig.Time != nil {
verifyOptions.CurrentTime = tlsConfig.Time()
}
_, err := state.PeerCertificates[0].Verify(verifyOptions) _, err := state.PeerCertificates[0].Verify(verifyOptions)
return err return err
} }

View File

@ -11,10 +11,13 @@ type TimeServiceWrapper struct {
} }
func (w *TimeServiceWrapper) TimeFunc() func() time.Time { func (w *TimeServiceWrapper) TimeFunc() func() time.Time {
if w.TimeService == nil { return func() time.Time {
return nil if w.TimeService != nil {
return w.TimeService.TimeFunc()()
} else {
return time.Now()
}
} }
return w.TimeService.TimeFunc()
} }
func (w *TimeServiceWrapper) Upstream() any { func (w *TimeServiceWrapper) Upstream() any {

View File

@ -2,7 +2,7 @@
icon: material/alert-decagram icon: material/alert-decagram
--- ---
#### 1.12.0-rc.2 #### 1.12.0-rc.3
* Fixes and improvements * Fixes and improvements