mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-14 00:51:12 +03:00
22 lines
344 B
Go
22 lines
344 B
Go
package adapter
|
|
|
|
import (
|
|
"context"
|
|
"crypto/x509"
|
|
|
|
"github.com/sagernet/sing/service"
|
|
)
|
|
|
|
type CertificateStore interface {
|
|
LifecycleService
|
|
Pool() *x509.CertPool
|
|
}
|
|
|
|
func RootPoolFromContext(ctx context.Context) *x509.CertPool {
|
|
store := service.FromContext[CertificateStore](ctx)
|
|
if store == nil {
|
|
return nil
|
|
}
|
|
return store.Pool()
|
|
}
|