hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.28k stars 4.43k forks source link

Vagrant 2.3.5 (Windows/AMD64) plugin update SSL verification error #13156

Closed dannmartens closed 1 year ago

dannmartens commented 1 year ago

After installing Vagrant 2.3.5 (Windows/AMD64) and VMware Utility 1.0.22, resuming failed:

$ vagrant resume
Vagrant failed to initialize at a very early stage:

The plugins failed to initialize correctly. This may be due to manual
modifications made within the Vagrant home directory. Vagrant can
attempt to automatically correct this issue by running:

  vagrant plugin repair

If Vagrant was recently updated, this error may be due to incompatible
versions of dependencies. To fix this problem please remove and re-install
all plugins. Vagrant can attempt to do this automatically by running:

  vagrant plugin expunge --reinstall

Or you may want to try updating the installed plugins to their latest
versions:

  vagrant plugin update

Error message given during initialization: Unable to resolve dependency: user requested 'vagrant-vmware-desktop (= 3.0.1)'

Normally, I would simply update the plugins to install the corresponding version for the VMware utility, but this time:

$ vagrant plugin update
Updating installed plugins...
ERROR:  SSL verification error at depth 3: unable to get local issuer certificate (20)
ERROR:  You must add /C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 Certification Authority to your local trusted store
Vagrant failed to load a configured plugin source. This can be caused
by a variety of issues including: transient connectivity issues, proxy
filtering rejecting access to a configured plugin source, or a configured
plugin source not responding correctly. Please review the error message
below to help resolve the issue:

  SSL_connect SYSCALL returned=5 errno=0 peeraddr=18.165.183.17:443 state=error: certificate verify failed (https://gems.hashicorp.com/specs.4.8.gz)

Source: https://gems.hashicorp.com/

I have uninstalled 2.3.5 and re-installed 2.3.4 so I can continue working.

alexkart commented 1 year ago

I have the same issue with Vagrant 2.3.5

ciarancourtney commented 1 year ago

Me too, found this workaround for now

vagrant plugin install --plugin-clean-sources --plugin-source https://rubygems.org vagrant-*
chrisroberts commented 1 year ago

@alexkart @ciarancourtney are you both on windows as well?

alexkart commented 1 year ago

@alexkart @ciarancourtney are you both on windows as well?

Yes.

WengZhenxing commented 1 year ago

Me too, found this workaround for now

vagrant plugin install --plugin-clean-sources --plugin-source https://rubygems.org vagrant-*

workd for me

PaulNeumann commented 1 year ago

I still see this issue with Vagrant 2.3.6 Windows/AMD64 (upgraded from 2.3.4) on Windows 10. The workaround worked for me as well.

mloskot commented 1 year ago

I can confirm, updating from Vagrant 2.3.4 to 2.3.6 on Windows 11 completely breaks Vagrant setup. This happened to me on two machines, so there must be a bug.

Trying https://github.com/hashicorp/vagrant/issues/13156#issuecomment-1551561004 with this worked for me too:

C:\>vagrant plugin install --plugin-clean-sources --plugin-source https://rubygems.org vagrant-reload vagrant-vbguest winrm winrm-elevated
marlop352 commented 1 year ago

better workaround:

drop https://curl.se/ca/cacert.pem in "C:\HashiCorp\Vagrant\embedded"

that fixes it for me, as that's what https://github.com/hashicorp/vagrant-installers/pull/270 was supposed to do.

dannmartens commented 1 year ago

I ended up putting the cacert.pem manually in C:\HashiCorp\Vagrant\embedded as @marlop352 proposed.

The first workaround which was proposed earlier kept giving me the same error:

$ vagrant plugin install --plugin-clean-sources --plugin-source https://rubygems.org vagrant- Installing the 'vagrant-' plugin. This can take a few minutes... ERROR: SSL verification error at depth 3: unable to get local issuer certificate (20) ERROR: You must add /C=US/O=Starfield Technologies, Inc./OU=Starfield Class 2 Certification Authority to your local trusted store

I tried a curl one-liner, but note that access to C:\HashiCorp\Vagrant\embedded requires elevated privileges (Administrator: Command Prompt):

C:\> curl -o "C:\HashiCorp\Vagrant\embedded\cacert.pem" https://curl.se/ca/cacert.pem
mloskot commented 1 year ago

@dannmartens FYI, https://github.com/hashicorp/vagrant/issues/13167#issuecomment-1570512120