Skip to content
This repository has been archived by the owner on Jan 30, 2021. It is now read-only.

certificat file from OSX #10

Closed
brettswift opened this issue Apr 20, 2014 · 9 comments
Closed

certificat file from OSX #10

brettswift opened this issue Apr 20, 2014 · 9 comments

Comments

@brettswift
Copy link

.vagrant.d/gems/gems/azure-0.6.3/lib/azure/base_management/base_management_service.rb:68:invalidate_configuration': Could not read from file '~/.ssh/azure/azure.cer'. (RuntimeError)`

I'm not sure if I'm using the correct command to generate the cert file, so it could be just me.. can't seem to find any links on google to create anything but a .pem file whereas azure says it will only allow me to upload a .cer file.

I've tried:
openssl req -new -x509 -extensions v3_ca -out azure.pem -days 3650

then converted that to a .cer file... also tried the above with just a .cer extension.

@jeffmendoza
Copy link
Contributor

These commands worked for me:

openssl req -out CSR.csr -key .ssh/vagrant_rsa -new
openssl x509 -req -days 365 -in ./CSR.csr -signkey ./.ssh/vagrant_rsa -out vagrant.crt

@brettswift
Copy link
Author

This is what ended up working for me. pfx file not used, but here for reference.

Sourced from: http://ben.lobaugh.net/blog/710/generating-certificates-for-use-with-the-windows-azure-management-api

@jeffmendoza I tried your approach but kept getting an error

                openssl req -x509 -nodes -days 3650  -newkey rsa:1024 -keyout cert.pem -out cert.pem
                openssl pkcs12 -export -out cert.pfx -in cert.pem -name "My Cert"
                openssl x509 -inform pem -in cert.pem -outform der -out cert.cer

@philbert
Copy link

Spent hours trying to figure out how to generate these keys correctly until I finally discovered this issue. This information really needs to be documented somewhere!

@martinmendez
Copy link

I have followed all the steps you guys mentioned above and also the instructions in Ben Lobaugh post but still can't connect my vagrant to Azure. How finally you solved this issue ?. I am stuck with the error .vagrant.d/gems/gems/azure-0.6.3/lib/azure/base_management/base_management_service.rb:68:invalidate_configuration': Could not read from file '~/path/to/my.cer'. (RuntimeError)`. Thanks

@philbert
Copy link

Figured I wouldn't be the last, which is why I wrote this:
https://github.com/phiche/vagrant-azure-example

@martinmendez
Copy link

Thank you very much phiche ! it worked.

@brettswift
Copy link
Author

@Phiche thanks for the example project.

I've returned to tackling this after a bit of a hiatus, and unfortunately still don't have this working.

I get a different behaviour depending on which VM I use. Has anyone tried this with a CentOS image?

yum -y install rsync fails on the CentOS 6.5 Minimal image, and on a full 6.5-x64 image, ssh will never connect.

one example output:

==> nodeserver: Waiting for SSH
==> nodeserver: Looking for 22
==> nodeserver: Looking for 22
==> nodeserver: Inserting Vagrant public key within guest...
==> nodeserver: Key inserted! Disconnecting and reconnecting using new SSH key...
==> nodeserver: Looking for 22
==> nodeserver: SSH Ready
==> nodeserver: Installing rsync to the VM...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

yum -y install rsync

Stdout from the command:


yum -y install rsync
exitcode=$?
printf

Stderr from the command:

@brettswift brettswift reopened this Nov 17, 2014
@brettswift
Copy link
Author

I'm pretty sure this is the VM and not the vagrant-azure plugin.

The above error was using this:
azure.vm_image = '0b11de9248dd4d87b18621318e037d37__RightImage-CentOS-6.5-x64-v14.1.3'

I get a different error using:
azure.vm_image = '5112500ae3b842c8b9c604889f8753c3__OpenLogic-CentOS-65-20140926'

mkdir -p '/vagrant'
exitcode=$?
printf

Stderr from the command:

So one fails with a yum install and one creating a folder.

Unfortunately I don't get a lot of output. I'll add debug information if I can get it to generate some with --debug.

@brettswift
Copy link
Author

Closing again. This definitely is due to the VM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants