[Unsolved] Got “Peer certificate cannot be authenticated with known CA certificates” while using Twitter OAuth with PHP PECL_OAuth

Here is a dump for $oauth->debugInfo. ($oauth is an OAuth class from PECL_OAuth)

array(2) { [“sbs”]=> string(240) “POST&https%3A%2F%2Fapi.twitter.com%2Foauth%2Frequest_token&oauth_consumer_key%3***%26oauth_nonce%3D16905507154beeed8c5ce2d0.02323759%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1273949580%26oauth_version%3D1.0” [“info”]=> string(537) “About to connect() to api.twitter.com port 443 (#0) Trying 128.242.245.125… connected Connected to api.twitter.com (128.242.245.125) port 443 (#0) SSLv3, TLS handshake, Client hello (1): SSLv3, TLS handshake, Server hello (2): SSLv3, TLS handshake, CERT (11): SSLv3, TLS alert, Server hello (2): SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Closing connection #0 Peer certificate cannot be authenticated with known CA certificates ” }

The exception message is like this:
Invalid auth/bad request (got a -1, expected HTTP/1.1 20X or a redirect)

It happens only on MAMP environment. It doesn’t occur on CentOS5.4. The script works on http://twitter.com/ (non SSL), so the problem might be in CA certificates on Mac. But currently I have no idea how to fix it.

This entry was posted in Tweak. Bookmark the permalink. Both comments and trackbacks are currently closed.