Older android missing certificate

This commit is contained in:
Ginder Singh
2023-11-09 16:33:48 +00:00
committed by Cuong Manh Le
parent 09188bedf7
commit c3b4ae9c79
2 changed files with 3 additions and 2 deletions

View File

@@ -1149,7 +1149,7 @@ func processCDFlags(cfg *ctrld.Config) error {
}
if err != nil {
if isMobile() {
return errors.New("could not fetch resolver config")
return err
}
logger.Warn().Err(err).Msg("could not fetch resolver config")
return err

View File

@@ -10,6 +10,7 @@ import (
"net"
"net/http"
"os"
"runtime"
"strings"
"time"
@@ -119,7 +120,7 @@ func postUtilityAPI(version string, cdDev bool, body io.Reader) (*ResolverConfig
return d.DialContext(ctx, network, addrs)
}
if router.Name() == ddwrt.Name {
if router.Name() == ddwrt.Name || runtime.GOOS == "android" {
transport.TLSClientConfig = &tls.Config{RootCAs: certs.CACertPool()}
}
client := http.Client{