0

I'm currently using PHP/cURL to connect to an API (xero.com) using a client certificate/key they provided.

I keep running into this error:

Curl error (56): SSL read: errno -5961

The corresponding cURL error is CURLE_RECV_ERROR.

Google has not been helpful. Any clue on what could cause this? Fixes?

2 Answers 2

1

Any clue on what could cause this? Fixes?

According to other reports, it appears your SSL session is timing out. See, for example, Root cause of “curl: (56) SSL read: errno -5961” errors.

The client certificate would be the first thing I would checked, though.

Can you duplicate the problem on the command line with OpenSSL's s_client?


Google has not been helpful.

When you search, you have to quote -5961: "-5961". Otherwise, Google treats it like an exclude predicate.

Sign up to request clarification or add additional context in comments.

Comments

0

The solution was that I was using a certificate PEM file with multiple certificates and OpenSSL / cURL was simply using the first certificate (which was the wrong one). The error message did not help.

Once I pulled the correct certificate into its own file everything started magically working.

The moral here is if you're running across this issue, check your key, check your certificate, cross your t's, and dot your i's.

1 Comment

Hi, I am running into a similar issue. When I curl in PHP locally on my MB to an external HTTPS host, I get : SSLRead() return error -9806 This is after the Yosemite update. Before on Mavericks I didn't had this problem. I have no idea where to start looking. Curling to the HTTP domain of the same address works fine. Only HTTPS give this error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.