OSX Mavericks broke cURL use with self-signed client certificates.

So the path to here was:

  1. Let’s play with an API and POSTMan / Jetpacks.
  2. Can’t use the work API, not from home at least
  3. How about BetFair?
  4. Signup at http://developer.betfair.com, create API tokens etc
  5. Create a self-signed certificate with Keychain Access, which looks like it should work. But it doesn’t, with the error “curl: (56) SSLRead() return error -9841”
  6. Cryptic post on a forum indicates “-k” doesn’t work for cURL on OSX. remove that and get the error {“loginStatus”:”CERT_AUTH_REQUIRED”}
  7. Maybe it was something in Keychain Access. Open iTerm and create one with openssl at the command line. Same error.
  8. Go for a deep, deep dive. Eventually find this post wherein it is revealed that Apple has made some changes and –cert has broken. Not only that, the suggestion is to download and compile the latest curl, then use .p12 files since .PEM isn’t supported in the Security API. <Sigh>
  9. Leave this aside for later. I should have quit earlier and searched programmable web for something else to play with.

Edit: Found and fixed the issue, steps in this post.

Leave a Reply

Your email address will not be published. Required fields are marked *