openindiana - curl CA failure

There is a bug in openindiana that does not let you get the content of a page with curl, when it’s secured with ssl. The cause of this is an option set on compile time. This option is the the path to the certificate storage. In the case of openindiana this is set to /etc/curl/curlCA, but all certificates reside in /etc/certs/CA/. This leads to the following error message, when you try it:

curl: (77) error setting certificate verify locations

To fix this, run the following script.

mkdir /etc/curl && cat /etc/certs/CA/*.pem > /etc/curl/curlCA

This writes all certificates of the default CA in the file curl is looking for and after that, it works.