Closed adriangibanelbtactic closed 7 years ago
Hi,
Thanks for the tip, it helped, adding the complete procedure with self signed certificate support.
2.if you are using self signed certificates, you should add the following at (line 93 ) curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, $this->rest_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch ,CURLOPT_ENCODING,'gzip');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
//to allow self signed certificates.
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
BM
@boombata Could you fork this repo, make all these changes, and do a pull request against the "hotfix" branch.
@chris001 PR#8 submitted. I just removed the preg_replace as i'm not sure about its utility feel free to correct my lack of knowledge :)
This happened to us when using plugin from Joomla: Joomla Portal 1.1.1 for Joomla 3.x.zip . We suspect this is based on Joomla3 branch.
This issue only affects the ability to upload files to the Sugarcrm when the Sugarcrm url is setup as:
https://crm.domain.com
that it's with: https .
Either the problem is in:
A)
https://github.com/salesagility/SuiteCRM-Portal-Joomla/blob/eaf8aecf5641c4ce3effba420152f9f0adca0fb6/site/sugarRestClient.php#L68
which I workaround with:
but that should be updated with a proper sentence that handles both http or https.
B) Or in that $this->base_url is not used at all in many of the requests while the "Upload files" functions uses it.
Take a look at:
https://github.com/salesagility/SuiteCRM-Portal-Joomla/blob/eaf8aecf5641c4ce3effba420152f9f0adca0fb6/site/sugarRestClient.php#L351
which uses $this->base_url .
Every other function on that file seems to use: rest_request function which seems not to use: $this->base_url but $this->rest_url instead.
So I guess that if you ever setup a Sugarcrm URL without http or https the normal functions won't work even if you initially planned to workaround it with $this->base_url .
Unless curl functions can use url without http:// at its beginning.
C) So the summary is:
C)1) I am able to workaround my problem by doing this change and I should not be able to do so.
https://github.com/salesagility/SuiteCRM-Portal-Joomla/blob/eaf8aecf5641c4ce3effba420152f9f0adca0fb6/site/sugarRestClient.php#L68
which I workaround with:
C)2) I suspect that autocomplete of url by prepending http (or https) does not work correctly in practice but I might be wrong.