unable to load client cert: -8018 (SEC_ERROR_UNKNOWN_PKCS11_ERROR)

If you get this strange curl error

* Connected to xxx.yyy.com (111.222.111.222) port 443 (#2)
* unable to load client cert: -8018 (SEC_ERROR_UNKNOWN_PKCS11_ERROR)
* NSS error -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.