unable to load client cert: -8018 (SEC_ERROR_UNKNOWN_PKCS11_ERROR)

If you get this strange curl error

* Connected to xxx.yyy.com ( port 443 (#2)
* unable to load client cert: -8018 (SEC_ERROR_UNKNOWN_PKCS11_ERROR)
* Unknown PKCS #11 error.
* Closing connection 2

Then you probanly are using curl compilled with NSS on Centos/Fedora. Sometimes NSS did not handle all certificates correctly and to fix this you should change curl version witl curl version compilled with OpenSSL.