获取curl:(60)使用aws命令发出SSL证书错误

时间:2014-03-26 06:56:55

标签: curl ssl amazon-s3

当我在终端上使用aws ls myBucketaws mkdir newBucket访问我的S3时,我得到了:

curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.

If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.

我不熟悉curl,怎么能解决这个问题?我的操作系统是OSX 10.9.2

谢谢!

1 个答案:

答案 0 :(得分:0)

你的水桶是否包含点,例如com.example.mybucket?另外我假设你使用Tim Kay的这个aws Perl client

如果是,那么问题与幕后的事实有关,这个客户端执行virtual-hosted-style requests,例如GET https://com.example.mybucket.s3.amazonaws.com/...

  

注意:您可以按照以下方式验证:aws --curl-options="-v" ls com.example.mybucket 2>&1 | grep "About to connect"

此类虚拟主机样式请求会导致certificate verification problem

所以,我强烈建议您使用官方的 AWS Command Line Interface 。使用它就像:

aws s3 ls com.example.mybucket

或者,穷人解决方案是关闭证书验证,详见curl,如下所示:

aws --curl-options="-k" ls com.example.mybucket