mirror of https://github.com/jetkvm/kvm.git
fix(ota): certificate signed by unknown authority
This commit is contained in:
parent
1a30977085
commit
652e845d83
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)
|
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)
|
||||||
|
|
Loading…
Reference in New Issue