08-04-2014 22:31
08-04-2014 22:31
Hi
I've moved my application from centos to rhel6 and after this everytime I tried to connect to fitbit's api I get this error
Fatal error: Uncaught exception 'OAuthException' with message 'making the request failed (SSL connect error)' in /var/www/html/includes/fitbitphp.php:184 Stack trace: #0 /var/www/html/includes/fitbitphp.php(184): OAuth->getRequestToken('https://api.fit...', 'https://gtefina...') #1 /var/www/html/fitbit.php(26): FitBitPHP->initSession('https://gtefina...') #2 {main} thrown in /var/www/html/includes/fitbitphp.php on line 184
Any idea what's happening? it seems like a ssl connection error but I don't know where to look for in my server and it's the same working code I had in the previous server.
thank you for your help
08-05-2014 09:19
08-05-2014 09:19
Do you have SSH access to the box? If so, try curl'ing https://api.fitbit.com.
See if you get any errors there.
Example:
$ curl -vvv https://api.fitbit.com/oauth/request_token * Adding handle: conn: 0x7fd15100e600 * Adding handle: send: 0 * Adding handle: recv: 0 * Curl_addHandleToPipeline: length: 1 * - Conn 0 (0x7fd15100e600) send_pipe: 1, recv_pipe: 0 * About to connect() to api.fitbit.com port 443 (#0) * Trying 108.168.254.64... * Connected to api.fitbit.com (108.168.254.64) port 443 (#0) * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 * Server certificate: *.fitbit.com * Server certificate: Go Daddy Secure Certificate Authority - G2 * Server certificate: Go Daddy Root Certificate Authority - G2 * Server certificate: Go Daddy Class 2 Certification Authority > GET /oauth/request_token HTTP/1.1 > User-Agent: curl/7.30.0 > Host: api.fitbit.com > Accept: */* > < HTTP/1.1 400 Bad Request * Server nginx is not blacklisted < Server: nginx < Date: Tue, 05 Aug 2014 16:18:12 GMT < Content-Type: application/json;charset=UTF-8 < Content-Length: 176 < Connection: keep-alive < X-UA-Compatible: IE=edge,chrome=1 < Set-Cookie: JSESSIONID=7BD9F524E840DA6D5E88F50DFD5533A9.fitbit1; Path=/ < WWW-Authenticate: OAuth realm="https%3A%2F%2Fapi008-g4.prod.dal05.fitbit.com" < Set-Cookie: fhttps=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/ < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Cache-control: no-store, no-cache, must-revalidate < Pragma: no-cache < Content-Language: en-US < Vary: Accept-Encoding < X-Frame-Options: SAMEORIGIN < * Connection #0 to host api.fitbit.com left intact {"errors":[{"errorType":"oauth","fieldName":"n/a","message":"No Authorization header provided in the request. Each call to Fitbit API should be OAuth signed"}],"success":false}