Alibaba Cloud OSS reports SSL certificate problem: unable to get local issuer certificate

The following content operates in the PHP environment

When using Alibaba Cloud OSS to obtain an encrypted URL, the default domain name used is the domain name set by $oss_endpoint. If you want to set it as your own domain name, you first need to bind the domain name in the transmission management, and then set it to The bound domain name.

$oss_endpoint   = 'https://www.test.com'
$oss_client     = new OssClient($oss_key_id, $oss_key_secret, $oss_endpoint,true);

If the link uses HTTP, there is no problem, but if the link uses HTTPS, an error will be reported (not necessarily, see whether the corresponding certificate has been deployed in the environment)

RequestCoreException: cURL error: SSL certificate problem:unable to get local issuer certificate

The error is obvious, the SSL certificate verification problem, the local certificate is not configured. If you look at the problem, configuring the certificate is the solution to the problem, but if you don't want to configure the certificate, it can be solved, of course.

Find the src/OSS/Http/RequestCore.php file in the SDK of the certificate, and find

 public $ssl_verification = true

The default is to enable verification. If it is changed to false, the problem will be solved.

Guess you like

Origin blog.csdn.net/a7442358/article/details/124828806