Add certificate store

This commit is contained in:
世界
2025-01-08 10:34:45 +08:00
parent 90ec9c8bcb
commit 17576e9f66
30 changed files with 4786 additions and 32 deletions

View File

@@ -3,6 +3,7 @@ package clashapi
import (
"archive/zip"
"context"
"crypto/tls"
"io"
"net"
"net/http"
@@ -15,6 +16,7 @@ import (
"github.com/sagernet/sing/common"
E "github.com/sagernet/sing/common/exceptions"
M "github.com/sagernet/sing/common/metadata"
"github.com/sagernet/sing/common/ntp"
"github.com/sagernet/sing/service/filemanager"
)
@@ -60,6 +62,10 @@ func (s *Server) downloadExternalUI() error {
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
return detour.DialContext(ctx, network, M.ParseSocksaddr(addr))
},
TLSClientConfig: &tls.Config{
Time: ntp.TimeFuncFromContext(s.ctx),
RootCAs: adapter.RootPoolFromContext(s.ctx),
},
},
}
defer httpClient.CloseIdleConnections()