Windows gcp 列表对象失败 - 卷曲错误 [77]

Windows gcp List objects fails - Curl error [77]

尝试列出 google 存储桶中的所有对象 - 此代码 运行 在 UNIX 系统(centos 7/Mac)中没问题,但是当 运行从 windows 服务器 2012/16 Vm 我在 ListObjects 中收到永久错误:EasyPerform() - CURL 错误 [77]=SSL CA 证书问题(路径?访问权限?)[未知]

void gcpFileDialog::getListOfObjectsInBucket()
{
    QString bucket = "exampleBucketName";///_gcpBucketLineEdit->text();
    if ((bucket.isNull()) || (bucket.isEmpty()))
    {
        QMessageBox::critical(this, tr("Error"), tr("GCP Bucket is invalid"));
        return;
    }

    namespace gcs = ::google::cloud::storage;

    // Create a client to communicate with Google Cloud Storage. This client
    // uses the default configuration for authentication and project id.
    google::cloud::StatusOr<gcs::ClientOptions> options = gcs::ClientOptions::CreateDefaultClientOptions();
    google::cloud::StatusOr<gcs::Client> client = gcs::Client::CreateDefaultClient();

    if (!client)
    {
        QMessageBox::critical(this, tr("Error"), tr("Failed to create Storage Client.\n\n%1").arg(QString::fromStdString(client.status().message())));
        return;
    }

    QStringList objectsInBucketList;
    for (auto&& object_metadata : client->ListObjects(bucket.toStdString()))
    {
        if (!object_metadata)
        {
            QMessageBox::critical(this, tr("Error"), tr("There was an Error listing the objects.\n\n%1").arg(QString::fromStdString(object_metadata.status().message())));
            client->ListObjects
            return;
        }

        objectsInBucketList.append(QString::fromStdString(object_metadata->name()));
    }

    if (objectsInBucketList.isEmpty())
    {
        QMessageBox::critical(this, tr("Error"), tr("No Objects found in bucket"));
        return;
    }

    for (QString& object : objectsInBucketList)
    {
        ///list of bucket object _gcpBucketObjectListTextEdit->append(object);
    }
}

我对 curl/open ssl 证书几乎一无所知(我也不认为这与 google 托管 ssl 证书有关) 我已经使用 Choco 在主机 vm 上安装了 openssl 和 curl,并添加了很多服务器角色和功能。

从 Google Cloud SDK Shell 调用该命令时有效 - GSUTIL 如果您能帮助追踪问题,我们将不胜感激。

我认为您需要按照以下说明安装证书包:

https://curl.se/docs/sslcerts.html

对于 google-cloud-cpp 的较新版本,您可以使用 CARootsFilePathOption 覆盖 CA 证书文件的默认位置。