123456789101112131415161718192021222324 |
- package adapter
- import (
- "context"
- "crypto/x509"
- "github.com/sagernet/sing/service"
- )
- type CertificateStore interface {
- LifecycleService
- Pool() *x509.CertPool
- TLSDecryptionEnabled() bool
- TLSDecryptionCertificate() *x509.Certificate
- TLSDecryptionPrivateKey() any
- }
- func RootPoolFromContext(ctx context.Context) *x509.CertPool {
- store := service.FromContext[CertificateStore](ctx)
- if store == nil {
- return nil
- }
- return store.Pool()
- }
|