cURL and SSL
Error Message
curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the
--cacert
option.CURL SSL Certificate Issue Summary
The SSL certificate error occurs because curl doesn't have all the root certificates installed that a web browser would normally know about.
The solution is to tell curl which certificate authority bundle to use for this command or to turn off the certificate validation. The first option is preferable because it is more secure.
Referencing a Certificate Authority Bundle
You should carefully consider where to get your certificate authority bundle. There are a number of secure sources. Your university may have a particular bundle they prefer to use.
You can download the Mozilla CA Cert bundle in PEM format (cacert.pem) from: http://curl.haxx.se/docs/caextract.html
Once you have downloaded a bundle, you can reference it in your curl command using the --cacert command line option.
Example:
curl -u <user-name>:<api-key> -F "data=@<file>" "https://<your-subdomain>.gradesfirst.com/api/import" --cacert cacert.pem
Turning Off Certificate Validation
You can turn off the SSL certificate validation by adding the -k command line switch to your curl command.