fix(ota): certificate signed by unknown authority (#338)

This commit is contained in:
Aveline 2025-04-09 20:29:03 +02:00 committed by GitHub
commit 7e83e24e07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

6
ota.go
View File

@ -126,12 +126,10 @@ func downloadFile(ctx context.Context, path string, url string, downloadProgress
return fmt.Errorf("error creating request: %w", err) return fmt.Errorf("error creating request: %w", err)
} }
// TODO: set a separate timeout for the download but keep the TLS handshake short
// use Transport here will cause CA certificate validation failure so we temporarily removed it
client := http.Client{ client := http.Client{
// allow a longer timeout for the download but keep the TLS handshake short
Timeout: 10 * time.Minute, Timeout: 10 * time.Minute,
Transport: &http.Transport{
TLSHandshakeTimeout: 1 * time.Minute,
},
} }
resp, err := client.Do(req) resp, err := client.Do(req)