且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

AWS SSL 安全错误:[curl] 60:SSL 证书问题...:无法获得本地颁发者证书

更新时间:2022-05-08 05:17:13

正如 Jeremy Lindblom 在注释,AWS SDK v2 的解决方案是在实例化 SDK 时设置 ssl.certificate_authority 选项:

As mentioned by Jeremy Lindblom in the comments, the solution for AWS SDK v2 is to set the ssl.certificate_authority option when instantiating the SDK:

$aws = AwsCommonAws::factory(array(
    'region' => 'us-west-2',
    'ssl.certificate_authority' => '/path/to/updated/cacert.pem'
));

http://docs.aws.amazon.com/aws-sdk-php/guide/latest/faq.html#what-do-i-do-about-a-curl-ssl-证书错误

我要补充一点,这是在 AWS SDK v3 中更改的,这是新方法:

I'll add that this was changed in the AWS SDK v3, here is the new method:

$client = new DynamoDbClient([
    'region'  => 'us-west-2',
    'version' => 'latest',
    'http'    => [
        'verify' => '/path/to/my/cert.pem'
    ]
]);

http://docs.aws.amazon.com/aws-sdk-php/v3/guide/guide/configuration.html#verify