Asana PHP API Connection Error : 443 - php

I am trying to use the Asana PHP API to build a browser project for personal use, but I am facing problems with connecting to the API.
This is the response i get when trying to fetch the user data from the API.
Fatal error: Uncaught exception 'Httpful\Exception\ConnectionErrorException' with message 'Unable to connect to "https://app.asana.com/api/1.0/users/me": 35 Unknown SSL protocol error in connection to app.asana.com:443 ' in php-asana\vendor\nategood\httpful\src\Httpful\Request.php:208
Here is the code I am using for initializing and fetching the data
require 'php-asana/vendor/autoload.php';
$client = Asana\Client::accessToken(PERSONAL_ACCESS_TOKEN);
$users = $client->users->me();
print_r($users);
The app is set up on my local server. Is it necessary for the client server to have SSL in order to fetch data from the Asana API or am I doing something wrong?

You might be using a deprecated version of TLS to do your requests, please see Asana is now deactivating TLS 1.0
Additionally, the library you are using may not support secure connections

Related

Soap client stopped working

I have a website which frequently makes SOAP calls to a particular API. The site was working fine for a few months of time, however the SOAP functionality suddenly stopped working without any known reason, the error was "Cannot connect to host".
The WSDL service has not moved or shut down.
After this I updated plesk from version 12 to version 17. SOAP client is still not working but now its a different error:
SOAP-ERROR: Parsing WSDL: Couldn't load from (URL) : failed to load external entity (URL)
This is my SOAP call:
$opts = array('http'=>array('user_agent' => 'PHPSoapClient'));
$context = stream_context_create($opts);
libxml_disable_entity_loader(false);
$client = new SoapClient($url,array('stream_context' => $context,'cache_wsdl' => WSDL_CACHE_NONE));
Any possible solutions?
EDIT:
New information came in, so the API server had DNS problems, how can I restore my connection to the API?
Your php server is clearly not reaching out the soap server. This might help:
Try checking directly from php server if the service are reachable:
wget {url} > page.txt
nano (or equivalent) page.txt
Try using other program to consume the server, I suggest Soap Ui
On the php server try ping the service url and see if the IP is resolved.
Check if any other soap service is reachable, you can use this service
If this not help you coming up with a solution, post here the results to help others solving it.

Twitter API returns "could not authenticate you"

I'm trying fetch some data from Twitter API. I've got a shared host with SSL support and I've configured my Twitter developer account.
However, if I try to load my script (as per example) it returns:
{"errors":[{"code":32,"message":"Could not authenticate you."}]}
Fatal error: Uncaught Exception: Unknown SSL protocol error in connection to api.twitter.com:443 in
My script is based on https://github.com/J7mbo/twitter-api-php

Wechat : Sandbox API config Failed

Hi please support to troubleshoot the below error in Wechat Sandbox API Config:
I am integrating Wechat API in PHP application. I have created a test account in Wechat Sandbox API. But when configuring the API with URL and token its shows "Unable to configure".
When checking the ajax response it throws : {"errcode":-106,"errmsg":"token check fail"}
Thank you.
I got the "Unable to configure" message when testing the Getting Started wiki sample too. Trying to reach wx_sample.php returned a 500 Internal Server Error.
It was fixed after changing the owners for my directory and file, after that the token could be set in the sandbox - 'API Config'.

Dropbox API unable to fetch request tokens

I've developed a small Dropbox based app. I've done all the coding in PHP using symfony 1.4 and the dropbox-php library. Locally on my machine everything works just fine. But on a public test server the the dropbox-php library fails to retrieve the request tokens.
The app key and app secret are the same on both machines and I'm using the PHP OAuth extension as the OAuth library. The Dropbox App is in development mode and I've also enabled additional users for it from the Dropbox App Dashboard.
Not sure if this helps but here's the piece of code:
$oauth = new Dropbox_OAuth_PHP(sfConfig::get('app_dropbox_app_key'), sfConfig::get('app_dropbox_app_secret'));
$tokens = $oauth->getRequestToken();
...and this the exception thrown:
500 | Internal Server Error | Dropbox_Exception_RequestToken
We were unable to fetch request tokens. This likely means that your consumer key and/or secret are incorrect.
From the error message it looks like the the app key and app secret combination is wrong. But the combination is right since it works on my machine and I've been using it for days to develop this small app. The 43 port is open on the server and the php_oauth.dll is loading correctly.
Any ideas about what I'm doing wrong here?
I've switched to Dropbox_OAuth_Curl but it didn't work either. The error:
Curl error: (77) error setting certificate verify locations:
CAfile: rootca
CApath: none
So I've set:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
And it works.
Can this be somehow related to Dropbox_OAuth_PHP not working?

Facebook SDK error: uncaught curlexception: 28: connect() timed out! thrown in php

I just follow same code from Facebook SDK example.
If FB App point to my local desktop, it will get Facebook uid and user basic information (ex email) if APP get permission from OAUTH request.
But when I upload files to server, executing $facebook->api('/me');
Fatal error: Uncaught CurlException: 28: connect() timed out! thrown in
/xxx/src/facebook.php on line 622
I still can't figure out why. It comes from CURL or SSL setting?
My remote server support SSL and CURL is enabled. My local is only CURL but no SSL support.
I think my Facebook SDK is old version, only facebook.php without base_facebook.php.
I try to use new version but can't run any program because crt error.
You get this error because your host cannot access the Facebook API. It might have an old version of Open SSL, can you check the current version on the server?
Try to connect using SSL from your local setup as well as it might be easier to debug on your local machine.
Also, see about that crt (CRC?) error and try to fix that first (don't shave too many Yak's though).

Categories