Add -L flag to curl download command to automatically follow HTTP
redirects when downloading firmware images. This ensures that upgrade
operations work correctly when the firmware URI returns a redirect
response (e.g., 301, 302).
Signed-off-by: Arif Alam <arif.alam@netexperience.com>
This implements secure download by adding additional fields to the
upgrade command payload:
- use-local-certificates (boolean): When provided, enables secure download
and if true uses built-in certificates, if false requires below fields
- ca-certificate (string): base64 encoded cas.pem
- certificate (string): base64 encoded cert.pem
- private-key (string): base64 encoded key.pem
The following additional changes are included:
- Switches from wget to curl for downloading as curl supports using
certificates and in general seems more reliable
- An automatic download retry was added before reporting the failure
- When download fails, provides both exit code & http code to the cloud
Fixes: WIFI-14643
Signed-off-by: Paul White <paul@shasta.cloud>