+ DNS, Web: Entware: use special directory with the system root certificates

+ use custom RootsCA for HTTPS client, for server cert verify
This commit is contained in:
Simon Zolin
2020-03-04 15:11:17 +03:00
parent b345595dbf
commit 1000aef1d2
5 changed files with 68 additions and 10 deletions

View File

@@ -180,6 +180,8 @@ type ServerConfig struct {
FilteringConfig
TLSConfig
TLSv12Roots *x509.CertPool // list of root CAs for TLSv1.2
// Called when the configuration is changed by HTTP request
ConfigModified func()
@@ -338,6 +340,7 @@ func (s *Server) Prepare(config *ServerConfig) error {
MinVersion: tls.VersionTLS12,
}
}
upstream.RootCAs = s.conf.TLSv12Roots
if len(proxyConfig.Upstreams) == 0 {
log.Fatal("len(proxyConfig.Upstreams) == 0")