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
+1 -1
View File
@@ -1149,7 +1149,7 @@ func processCDFlags(cfg *ctrld.Config) error {
} }
if err != nil { if err != nil {
if isMobile() { if isMobile() {
return errors.New("could not fetch resolver config") return err
} }
logger.Warn().Err(err).Msg("could not fetch resolver config") logger.Warn().Err(err).Msg("could not fetch resolver config")
return err return err
+2 -1
View File
@@ -10,6 +10,7 @@ import (
"net" "net"
"net/http" "net/http"
"os" "os"
"runtime"
"strings" "strings"
"time" "time"
@@ -119,7 +120,7 @@ func postUtilityAPI(version string, cdDev bool, body io.Reader) (*ResolverConfig
return d.DialContext(ctx, network, addrs) 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()} transport.TLSClientConfig = &tls.Config{RootCAs: certs.CACertPool()}
} }
client := http.Client{ client := http.Client{