I want to know if it is possible to turn off SSL verification in PHP 7.2 in a configuration file let's say for example in php.ini instead of turning off SSL verification by using some code to turn it off.
I've seen many examples on the internet and stackoverflow where people suggest that you do:
$arrContextOptions=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
The reason I would like to turn if off is because I am on a network where SSL inspection is being done and my application I'm testing needs to load some images over HTTPS. I've tried pointing PHP to the CA cert of the organization where I'm busy doing the work. They use a CA cert that they created themselves which won't be included in any certificate bundles. Thus the current certificates that they gave me that were signed by that C.A is considered invalid by any good browser and even considered by OpenSSL.
I tried several things including pointing PHP to the locations or files mentioned here in the output of:
php -r "print_r(openssl_get_cert_locations());"```
Array
(
[default_cert_file] => /var/lib/ca-certificates/ca-bundle.pem
[default_cert_file_env] => SSL_CERT_FILE
[default_cert_dir] => /var/lib/ca-certificates/openssl
[default_cert_dir_env] => SSL_CERT_DIR
[default_private_dir] => /etc/ssl/private
[default_default_cert_area] => /etc/ssl
[ini_cafile] =>
[ini_capath] =>
)
I'm either not pointing PHP to the right CA cert or the errors I'm getting simply aren't verbose enough.
The call that fetches the images over HTTPS is to get_file_contents and the error I keep getting is:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed