I have no experience in this.
First contact your host.
https://www.php.net/manual/en/openssl.requirements.php
In order to use the OpenSSL functions you need to install the ? OpenSSL library. PHP 5 requires at least OpenSSL >= 0.9.6. However later PHP 5 versions have some compilation issues and should be used at least with OpenSSL >= 0.9.8 which is also a minimal version for PHP 7.0. Other versions (PHP >= 7.1.0) require OpenSSL >= 1.0.1.
Verification of certificates from php 5.6.0
Note* otherwise you can set the certificate as master or php.ini
<?php
var_dump(openssl_get_cert_locations());
If default_cert_file and default_cert_dir exist will be used as default.
Create a file called test.php
<?php
error_reporting(-1);
$ch = curl_init('https://tlstest.paypal.com/');
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));
// In wamp-like environments that do not come bundled with root authority certificates,
// please download 'cacert.pem' from "https://curl.haxx.se/docs/caextract.html" and set
// the directory path of the certificate as shown below:
//curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/wp-includes/certificates/ca-bundle.crt');
if ( !($res = curl_exec($ch)) ) {
error_log("Got " . curl_error($ch) . " when processing TLS 1.2 data",3,dirname (__FILE__).'/test.log');
curl_close($ch);
exit;
}
curl_close($ch);
echo $res;
call it from browser if all ok paypal replies with ok otherwise test.log will be created with the error curl.
Delete the file test.php and test.log
here is an example on how to update openssl 1.0.0 and curl for php legacy https://tomthorp.me/blog/installing-custom-openssl-and-curl-legacy-php
If you are running multiple PHP versions of PHP-FPM, do take special care that you don’t add your custom build directory as part of ldconfig . The effect of adding your build directory in as part of ldconfig, will tell linux to look at your build directory first, before looking at the default installed drivers. As a result, the next time any other PHP-FPM services are restarted, it will pick up the drivers in your build directory that are incompatible, and will make that PHP-FPM service unstable.
To make sure your custom version of PHP doesn’t interfere with your other PHP-FPM services, you have to add an over-ride into your PHP-FPM service. This will contain an environment variable that tells the service to use the drivers in this path.
Again, ask your host for advice if you are not familiar with the commands, please do not change anything, but try to explore this topic elsewhere ??