Thanks to my friend @GuilhermeNascimento for the response and @Bacco to have helped in the chat to solve the problem.
I finally got it resolved!
Let's take the necessary steps. I'm using PHP version 5.6.
Once you have made all the necessary settings in apache, you need to do a configuration for PHP.
First, we need to find the location of the certificate file PHP is reading. It can be seen through the
In my case, it returned the following:
"default_cert_file" => "/usr/lib/ssl/cert.pem",
"default_cert_file_env" => "SSL_CERT_FILE",
"default_cert_dir" => "/usr/lib/ssl/certs",
"default_cert_dir_env" => "SSL_CERT_DIR",
"default_private_dir" => "/usr/lib/ssl/private",
"default_default_cert_area" => "/usr/lib/ssl",
"ini_cafile" => "/usr/lib/ssl/cert.pem",
"ini_capath" => "",
Looking at the value of
default_cert_file , you now know where PHP reads the Certified Intermediates .
Explaining very quickly, the
cert.pem file contains a list of trusted certificates from each Certification Authority. It is called CA Bundle .
You should download it at this link and move it to the location returned in
default_cert_file . Or you can download it to a different location and set the location of your file through
openssl.cafile = /caminho/do/cacert.pem
Every time you make a request by PHP via
curl or any other function using the
wrapper https , using the
verify_peer option, PHP will read this file to find out which are the valid Certificate Authority.
After these operations, if the error shown in the question still remains, you must manually add the intermediate code of your SSL certificate at the end of the file.
The @Bacco user recommended me to access the browser itself and download this code.
See the image:
FromthemomentyouareaddinganewCAtoyoursystem, youaresayingyoutrust"blindly" in that entity, so just do
this is really if it is a certificate that you are sure
absolute of the origin and suitability.
Note : You can also find the code on the SSL Service Provider website, but in my case it worked better by downloading from the browser.
The code that you will download from the certificate will look something like this:
After that, edit the file marked as
default_cert_file in your PHP. In my case, I renamed
cert.pem after download. Now add the code of the certificate you downloaded from the browser (or the CA certificate you are using) and add it to the previously cited file. It is recommended that you put in the end of your.
After this you may have to restart Apache, but in my case, you did not need to.
CA Bundle Link: