Neither PUB key nor PRIV key: nested asn1 error (OpenSSL::PKey::RSAError)
I'm having issues with having LXD installed as a Snap package on Fedora 28.
I think this has to do with the SSL between the LXD host and the vagrant-lxd plugin. I do not know Ruby or the tools used well enough to figure this out. This is also my first attempt at using Vagrant in general.
I'm running everything as root until I have a smoother setup procedure for my current project.
To reproduce:
dnf update -y
dnf upgrade -y
dnf install snapd
snap install lxd
snap enable lxd
lxd init --auto --network-address=127.0.0.1 --network-port=8443
lxc config trust add /root/snap/lxd/current/.config/lxc/client.crt
wget https://releases.hashicorp.com/vagrant/2.2.3/vagrant_2.2.3_x86_64.rpm
dnf install vagrant_2.2.3_x86_64.rpm
vagrant plugin install vagrant-lxd
vagrant init --minimal debian/stretch64
vagrant up --provider lxd
At first I had this error:
The provider could not authenticate to the LXD daemon at https://127.0.0.1:8443.
You may need configure LXD to allow requests from this machine. The
easiest way to do this is to add your LXC client certificate to LXD's
list of trusted certificates. This can typically be done with the
following command:
lxc config trust add /root/.config/lxc/client.crt
You can find more information about configuring LXD at:
https://linuxcontainers.org/lxd/getting-started-cli/#initial-configuration
Full vagrant up --debug
here: https://gitlab.com/snippets/1798274
To narrow things down, I ran:
cp /root/snap/lxd/current/.config/lxc/client.crt /root/.config/lxc/
lxc config trust add /root/.config/lxc/client.crt [this told me it was already trusted]
After which, I got this error:
/root/.vagrant.d/gems/2.4.4/gems/hyperkit-1.2.0/lib/hyperkit/connection.rb:171:in `initialize': Neither PUB key nor PRIV key: nested asn1 error (OpenSSL::PKey::RSAError)
Full vagrant up --debug
here: https://gitlab.com/snippets/1798263
You'll see godfryd/lxc-ubuntu-18.10
instead of debian/stretch64
because I tried a different image in case that was the issue.
I then tried installing 0.3.2 to see if it was fixed in your newer release:
dnf install -y ruby-devel [whatever other stuff was needed that I already had]
cd /root/git/
git clone https://gitlab.com/catalyst-it/vagrant-lxd.git
cd /root/git/vagrant-lxd
bundle install
bundle exec rake build
vagrant plugin install pkg/vagrant-lxd-0.3.2.gem
This did not change the behaviour.
If there's more that you need me to send, let me know.