ideasonpurpose / basic-wordpress-vagrant

A fast, easy to use WordPress Vagrant environment modeled after managed WordPress hosting platforms like WP Engine and Flywheel.
MIT License
25 stars 3 forks source link

Certificate generation error #56

Closed jesskuz closed 7 years ago

jesskuz commented 7 years ago

I'm getting the following error when running vagrant up on this box, during the Generate self-signed ssl cert_ task ...

fatal: [default]: FAILED! => {"changed": true, "cmd": ["openssl", "req", "-new", "-nodes", "-x509", "-subj", "/C=US/ST=NY/L=NY/O=Basic WordPress Vagrant/CN=", "-days", "1000", "-key
out", "/etc/apache2/ssl/basic-wp.key", "-out", "/etc/apache2/ssl/basic-wp.crt"], "delta": "0:00:00.179925", "end": "2017-08-01 14:42:08.962669", "failed": true, "rc": 1, "start": "2
017-08-01 14:42:08.782744", "stderr": "Generating a 2048 bit RSA private key\n.......................+++\n.............................+++\nwriting new private key to '/etc/apache2/
ssl/basic-wp.key'\n-----\nend of string encountered while processing type of subject name element #4\nproblems making Certificate Request", "stdout": "", "stdout_lines": [], "warnin
gs": []}

I have fresh installs of both Vagrant and Ansible and am running on Ubuntu (Mint).

Any ideas why this might be happening? Thanks very much for any help.

jesskuz commented 7 years ago

Note: This appears to be an issue on just release 0.4.1. 0.3.7 appears to be working normally.

joemaller commented 7 years ago

What is the name of the directory you're running this in?

joemaller commented 7 years ago

FWIW, I just tried a bunch of strange directory names and couldn't get it to fail. (🎉)

joemaller commented 7 years ago

unrelated correction: an ü in the path name breaks provisioning. First Ansible task fails, so it might be failing earlier.

joemaller commented 7 years ago

Think I see what happened. The CN argument to OpenSSL was blank. Because of a naive assumption I made in the Vagrantfile, that variable is passed as nil if the vagrant-hostmanager plugin is not installed.

When I uninstall the plugin, I get the same error.

Quickest fix would be to install the plugin with vagrant plugin install vagrant-hostmanager but I'll try to get a patch posted shortly.

Thanks for finding this!

ref: https://stackoverflow.com/questions/12068928/apache-create-ssl-certficate-for-a-ip-adress

joemaller commented 7 years ago

@jesskuz Should be all set now, thanks again!

jesskuz commented 7 years ago

Thank you very much, @joemaller ! Appreciate your help.