CURL error 'Unable to communicate securely'
Re: CURL error 'Unable to communicate securely'
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.
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.
Re: CURL error 'Unable to communicate securely'
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:
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: That is the code of how we call Cleantalk:
Now I get the following answer:
Code: Select all
No CURL support compiled in or disabled allow_url_fopen in php.ini.
Here are some screenshots from php_info of the system producing said error: 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);
-
- Posts: 37
- Joined: 18 Nov 2016, 10:38
- Has thanked: 0
- Been thanked: 4 times
Re: CURL error 'Unable to communicate securely'
It looks like hosting issue. Could you please check CURL option in hosting panel, is it enable?
Re: CURL error 'Unable to communicate securely'
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?
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);
-
- Posts: 37
- Joined: 18 Nov 2016, 10:38
- Has thanked: 0
- Been thanked: 4 times
Re: CURL error 'Unable to communicate securely'
Well, yeah, seems like curs is enabled properly. Please, give us a bit more time to think what else can be done here.
Re: CURL error 'Unable to communicate securely'
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?
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?
Re: CURL error 'Unable to communicate securely'
By the way, try to use most recent class file from GitHub:
https://github.com/CleanTalk/php-antispam
https://github.com/CleanTalk/php-antispam
-
- Posts: 37
- Joined: 18 Nov 2016, 10:38
- Has thanked: 0
- Been thanked: 4 times
Re: CURL error 'Unable to communicate securely'
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.
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.