bannerColor WARNING_YELLOW templateName poodleSSLVulnerability

PHP OAuth connection with LinkedIn API (Connection reset by peer)

9 posts / 0 new
Last post
Chris Harrell's picture
Joined: 2012-05-16
May 23, 2012
PHP OAuth connection with LinkedIn API (Connection reset by peer)

PHP 5.3.10
OAuth PECL v1.2.2

Hello, I have installed the latest OAuth PECL extension for PHP and tried to use the supplied sample code provided by LinkedIn with the appropriate API keys. Whenever I try to execute the code I get the following errors.

PHP Warning: OAuth::getRequestToken(): SSL: Connection reset by peer in /xxx/xxx/oauth.php on line 16
PHP Warning: OAuth::getRequestToken(https://api.linkedin.com/uas/oauth/requestToken): failed to open stream: HTTP request failed! in /xxx/xxx/oauth.php on line 16
ERROR: exception 'OAuthException' with message 'making the request failed (dunno why)' in /xxx/xxx/oauth.php:16
Stack trace:
#0 /xxx/xxx/oauth.php(16): OAuth->getRequestToken('https://api.lin...')
#1 {main}

I've tested the Twitter OAuth API and it seems to work correctly so I am really at my wits end. I haven't seem to be able to find anyone else that is having this issue, so I do not know where to begin. Any help would be greatly appreciated.

Jeremy Johnstone's picture
Joined: 2011-04-17
May 23, 2012

Hi Chris,

Odd. I have a suspicion it's an issue with your cacert bundle, but not positive. Could you try using http rather than https and see if there is still an issue to help narrow this down?

-Jeremy

Chris Harrell's picture
Joined: 2012-05-16
May 24, 2012

I get the exact same error, minus the first line which refers to the SSL connection.

Chris Harrell's picture
Joined: 2012-05-16
May 24, 2012

I tried a simple WGET on https://api.linkedin.com/uas/oauth/requestToken and I get "HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers." Wget reports error 400 on a different server, so it's definitely isolated to this one server.

Chris Harrell's picture
Joined: 2012-05-16
May 24, 2012

I get a Segmentation fault when I execute 'curl https://api.linkedin.com/uas/oauth/requestToken'

Why would this occur only for the LinkedIn SSL connection? I am able to use curl fine with Twitter's SSL URL.

Jeremy Johnstone's picture
Joined: 2011-04-17
May 24, 2012

Hi Chris,

No clue what's the issue, but it definitely seems like you have a broken server, especially because it works for me on multiple external machines and by your own statement also works for you on another box. I apologize, but not seen this issue before or anything even remotely related. Wish I could be of more help!

-Jeremy

Chris Harrell's picture
Joined: 2012-05-16
May 24, 2012

Thank you for attempting to assist with this. I had begun to think it was an issue with Ubuntu 12.04, but a fresh install seemed to not have the segfault issue. Needless to say I just moved my development environment to a different install. It bugs me that I do not know what exactly was causing the issue. It appears that things are working fine on this other install.

Jeremy Johnstone's picture
Joined: 2011-04-17
May 29, 2012

Hi Chris,

Totally know what you mean, I would be the same in your shoes. If you figure it out, please let us know!

-Jeremy

Chris Harrell's picture
Joined: 2012-05-16
Jun 4, 2012

Well, after working fine for a while it just stopped working on 12.04. Time to dig deeper into the rabbit hole.