Skip to content

Instantly share code, notes, and snippets.

@vheidari
Last active May 4, 2021 10:34
Show Gist options
  • Save vheidari/696e4f7ac5720aa9fcc3bf2abde34d4f to your computer and use it in GitHub Desktop.
Save vheidari/696e4f7ac5720aa9fcc3bf2abde34d4f to your computer and use it in GitHub Desktop.
MSYS2 - Curl ssl certification problems
#Add pem.sh script part in ~/bash/pem.sh
#----------------------------------------------------------------------------
#Start pem.sh script
#----------------------------------------------------------------------------
#cacert.pem name
CERT=cacert.pem
echo "Start fix curl ssl Certificat issus !"
echo "Start to Download pem file from : http://curl.haxx.se/ca/cacert.pem"
wget "http://curl.haxx.se/ca/${CERT}"
if test -f ${CERT}; then
echo ${CERT} ": is find."
mv ./cacert.pem /usr/ssl/
echo ${CERT} ": move to /usr/ssl"
export SSL_CERT_FILE=/usr/ssl/{$CERT}
echo "SSL_CERT_FILE: is set :)"
fi
#----------------------------------------------------------------------------
#End pem.sh script
#----------------------------------------------------------------------------
#then edit ~/.profile and add the following lines to it :
#----------------------------------------------------------------------------
#Start edit ~/.profile script
#----------------------------------------------------------------------------
PEMPATH = /bash/pem.sh
if[test -f ${HOME}${PEMPATH}]; then
source ${HOME}${PEMPATH}
fi
#----------------------------------------------------------------------------
#End edit ~/.profile script
#----------------------------------------------------------------------------
#More about curl ssl certificat verification : https://curl.se/docs/sslcerts.html
#A good link : https://sites.google.com/site/axusdev/builds/wget_and_curl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment