Fix SSL certificate check errors by using the system's certificate authorities, if it's possible.#93
Merged
msyk merged 8 commits intomsyk:masterfrom Sep 3, 2024
Merged
Conversation
…method also returning several types.
Specify return type on methods and correct "integer" to "int".
…warnings by PHP linters.
…ies instead of PHP's configuration (which can be unset or out of date).
Contributor
Author
|
Oups, it seems that I made a mistake on the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the project we are working on, another developer received
nullto some$layout->query()calls to fetch data from our database. After some investigations with XDebug, I finally found out that hisphp.inididn't have the cURLcurl.cainfoset. It was blank. This was causing cURL to not validate the SSL certificate of our FileMaker server.I downloaded a PEM file and set it with
curl.cainfo = "C:\dev\php8.3\ssl\cacert.pem"and this solved the problem.But this solution has some problems:
cacert.pemfile should ideally be updated from time to time.Later on, I saw that cURL added a new way to use the system's certificate authorities files, which are updated by system updates, which is far safer and easier to keep up to date.
I added the code with backward compatibility in the
callRestAPI()method of the communication provider.In the same time, I simplified the
if () {} else if () {} ...part for the different request methods by using a singleif.The other changes are just to improve a bit some type declarations and PHPDoc comments for the auto-complete and code linters. Hope I didn't do any mistake.