I have the same issue. After a lot of digging, I found the issue is we are missing our certificate for OpenSSL. So, I have fixed it by:
1. Download the certificate at:
https://curl.se/docs/caextract.html (click on cacert.pem to download it)
2. Run this command line in SSH to find where to put the certificate
php -r "print_r(openssl_get_cert_locations());"
In my case, it shows like these:
Array
(
[default_cert_file] => /usr/local/opensslso/cert.pem
[default_cert_file_env] => SSL_CERT_FILE
[default_cert_dir] => /usr/local/opensslso/certs
[default_cert_dir_env] => SSL_CERT_DIR
[default_private_dir] => /usr/local/opensslso/private
[default_default_cert_area] => /usr/local/opensslso
[ini_cafile] =>
[ini_capath] =>
)
3. Change file cacert.pem to cert.pem and upload it to folder: /usr/local/opensslso
Hope it will help someone.