theypsilon / Update_All_MiSTer

All-in-one script for updating your MiSTer
GNU General Public License v3.0
681 stars 28 forks source link

0 byte CACERT.PEM CURL certs block update_all from running - #110

Closed ihaveamo closed 10 months ago

ihaveamo commented 1 year ago

Found an issue where users can end up with 0 byte PEM file on /etc/ssl/certs/cacert.pem

The way update_all is written - the mere existence of (bad 0 byte) file skips any cert fixes, so the user is stuck - getting "can't connect to internet" type errors. I can see a lot of people think it's their wifi etc.

My suggestions in no particular order -

1. drop the /dev/null on so users can see if they are getting cert issues curl ${CURL_SSL:-} --fail --location -o "${DOWNLOAD_PATH}" "${DOWNLOAD_URL}" &> /dev/null

2. Modify the CASE statement:

60) if [ -f /etc/ssl/certs/cacert.pem ] ; then export CURL_SSL="--cacert /etc/ssl/certs/cacert.pem" continue fi

to also look for the existence of a 0 byte sized cacert.pem (& do something to fall through without the continue)

theypsilon commented 10 months ago

Thanks for opening the issue! I'm now handling the 0 byte case with -s and improving the installation process for the certificates.

I hope that helps!