开发者问题收集

如何修复在 Vagrant 中下载远程文件时无法检查证书吊销的问题

2021-06-07
5812

作为我的 Vagrantfile 的一部分,我有

config.vm.box = "hashicorp/bionic64"
  config.vm.provision "shell", path: "https://get.docker.com", name: "dockers"

我使用公司代理。我将公司证书附加到 C:\HashiCorp\Vagrant\embedded\cacert.pem 。此外,我将此环境变量 CURL_CA_BUNDLESSL_CERT_FILE 都设置为包含证书的 C:\HashiCorp\Vagrant\embedded\cacert.pem

vagrant up 仍然失败,并显示以下消息:

schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
 INFO interface: Machine: error-exit ["Vagrant::Errors::DownloaderError", "An error occurred while downloading the remote file. The error\nmessage, if any, is reproduced below. Please fix this error and try\nagain.\n\nschannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.\r"]

我猜是 Ruby(由 Vagrant 使用)找不到证书或获取撤销列表的调用被阻止。您知道这里的具体问题是什么以及如何修复它吗?

更新

在调试模式下,curl(可能是从 Ruby 调用?)似乎正在尝试下载文件

INFO downloader: Downloader starting download:
 INFO downloader:   -- Source: https://get.docker.com
 INFO downloader:   -- Destination: C:/Users/John/.vagrant.d/tmp/12288a08-a7ba-3d92-96ff-8bf28e739099-remote-script
 INFO subprocess: Starting process: ["C:\\HashiCorp\\Vagrant\\embedded\\bin/curl.EXE", "-q", "--fail", "--location", "--max-redirs", "10", "--verbose", "--user-agent", 
 "Vagrant/2.2.16 (+https://www.vagrantup.com; ruby2.6.7) ", "--output", "C:/Users/John/.vagrant.d/tmp/12288a08-a7ba-3d92-96ff-8bf28e739099-remote-script", "https://get.docker.com"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stderr:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 99.84.174.91:443...
* Connected to get.docker.com (99.84.174.91) port 443 (#0)
* schannel: ALPN, offering http/1.1
* schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
* Closing connection 0
* schannel: shutting down SSL/TLS connection with get.docker.com port 443
curl: (35) schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.
2个回答

看看这个 SO answer

正如那里提到的,禁用防病毒软件直到 vagrant init 初始化完成解决了这个问题。

Chris
2021-07-17

我使用的是 win10,没有安装任何第三方杀毒软件。我只是手动使用目录 .vagrant.d\boxes\ 中的虚拟机文件,打开 vmware 并扫描该目录。

scil
2023-04-11