mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
fix(ota): certificate signed by unknown authority
This commit is contained in:
6
ota.go
6
ota.go
@@ -126,12 +126,10 @@ func downloadFile(ctx context.Context, path string, url string, downloadProgress
|
||||
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{
|
||||
// allow a longer timeout for the download but keep the TLS handshake short
|
||||
Timeout: 10 * time.Minute,
|
||||
Transport: &http.Transport{
|
||||
TLSHandshakeTimeout: 1 * time.Minute,
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := client.Do(req)
|
||||
|
||||
Reference in New Issue
Block a user