CURL error 'Unable to communicate securely'

Support questions about API - PHP, Python, .NET and etc.

Re: CURL error 'Unable to communicate securely'

Unread postby fabianj » 30 Jan 2017, 15:39

We are just using the API class, not the client side integration with the cleantalk.custom.php ... So there is no moderate.cleantalk URLs we are contacting.
fabianj
 
Posts: 14
Joined: 06 Dec 2016, 16:41
Has thanked: 2 times
Been thanked: 0 time

Re: CURL error 'Unable to communicate securely'

Unread postby SergeM » 30 Jan 2017, 16:04

Hello.

Could you send us your code where you use our API method?
I presume we will be able to help you more effectively working with the specific code.

Thank you.
———————
Technical Support
https://CleanTalk.org — Anti-Spam Modules for all CMS
User avatar
SergeM
 
Posts: 72
Joined: 27 May 2016, 08:05
Has thanked: 8 times
Been thanked: 6 times

Re: CURL error 'Unable to communicate securely'

Unread postby fabianj » 31 Jan 2017, 09:18

Okay, so I actually found the part where moderate.cleantalk is called (sorry for the confusion) and I changed it to http://

Now I get the following answer:
Code: Select all
No CURL support compiled in or disabled allow_url_fopen in php.ini.

So, naturally we checked if everything was in place. curl is installed as a module. Running simple sample code of curl_exec works, plus we are using it in our running codebase, so it is there. allow_url_fopen is enabled.

Here are some screenshots from php_info of the system producing said error:
ct_curl1.PNG
ct_curl1.PNG (3.09 KiB) Viewed 347 times
ct_allow_url3.PNG
ct_allow_url3.PNG (5.4 KiB) Viewed 347 times
ct_allow_url2.PNG
ct_allow_url2.PNG (3.73 KiB) Viewed 347 times


That is the code of how we call Cleantalk:
Code: Select all
$ct_request = new CleantalkRequest();

$ct_request->auth_key = self::CT_AUTH_KEY;
$ct_request->agent = 'php-api';
$ct_request->sender_email = isset($user->email) ? $user->email : "";
$ct_request->sender_ip = $sender_ip;
$ct_request->sender_nickname = isset($user->username) ? $user->username : "_unknown_user_";
$ct_request->js_on = null;
$ct_request->message = $string;
$ct_request->post_info = "{'comment_type':'$region'}";
$ct_request->stoplist_check = 1;
$ct_request->response_lang = !empty($user->lang_ui) ? $user->lang_ui : "en";

$ct = new Cleantalk();
$ct->server_url = "http://moderate.cleantalk.org/api2.0/";

$ct_result = $ct->isAllowMessage($ct_request);
fabianj
 
Posts: 14
Joined: 06 Dec 2016, 16:41
Has thanked: 2 times
Been thanked: 0 time

Re: CURL error 'Unable to communicate securely'

Unread postby ArtyomDavydov » 31 Jan 2017, 16:53

It looks like hosting issue. Could you please check CURL option in hosting panel, is it enable?
ArtyomDavydov
 
Posts: 31
Joined: 18 Nov 2016, 10:38
Has thanked: 0 time
Been thanked: 4 times

Re: CURL error 'Unable to communicate securely'

Unread postby fabianj » 01 Feb 2017, 14:18

CURL is enabled. It works. We wrote a small test script to confirm that it is working with other.

The following test script executed on our server returns "Unknown request format", which I assume is the perfect response for an empty request.
And as far as I understand, it also proves that curl basically works on that machine?
Code: Select all
<?php
$ch = curl_init("https://moderate.cleantalk.org/api2.0");
$fp = fopen("file", "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
fclose($fp);
fabianj
 
Posts: 14
Joined: 06 Dec 2016, 16:41
Has thanked: 2 times
Been thanked: 0 time

Re: CURL error 'Unable to communicate securely'

Unread postby ArtyomDavydov » 01 Feb 2017, 16:51

Well, yeah, seems like curs is enabled properly. Please, give us a bit more time to think what else can be done here.
ArtyomDavydov
 
Posts: 31
Joined: 18 Nov 2016, 10:38
Has thanked: 0 time
Been thanked: 4 times

Re: CURL error 'Unable to communicate securely'

Unread postby znaeff » 01 Feb 2017, 16:52

Sounds good!
Could you make test script with isAllowMessage() call, filling ct_request fields by test strings?
And run it exactly on same environment as your test script above?
Alex Znaev,
http://cleantalk.org
server and client applications development
User avatar
znaeff
 
Posts: 314
Joined: 06 Jul 2012, 04:24
Has thanked: 1 time
Been thanked: 19 times

Re: CURL error 'Unable to communicate securely'

Unread postby znaeff » 03 Feb 2017, 13:02

By the way, try to use most recent class file from GitHub:
https://github.com/CleanTalk/php-antispam
Alex Znaev,
http://cleantalk.org
server and client applications development
User avatar
znaeff
 
Posts: 314
Joined: 06 Jul 2012, 04:24
Has thanked: 1 time
Been thanked: 19 times

Re: CURL error 'Unable to communicate securely'

Unread postby ArtyomDavydov » 08 Feb 2017, 15:27

Hello fabianj,

We can offer you our outsourcing services to solve this issue.
The cost of the work: 20$ per hour (approximate price is 60$).

If you agree, here's the necessary requirements to perform the work:
1. Account with administrator rights
2. Please, make a backup of your website
3. Send us your contacts (preferably Skype)

You can contact us at any time convenient for you.

Best regards.
ArtyomDavydov
 
Posts: 31
Joined: 18 Nov 2016, 10:38
Has thanked: 0 time
Been thanked: 4 times

Previous

Return to API support

Who is online

Users browsing this forum: No registered users and 1 guest

cron