5 Replies - 656 Views - Last Post: 19 February 2018 - 06:54 PM

#1 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3811
  • View blog
  • Posts: 13,850
  • Joined: 08-August 08

Install self-signed certificates for vagrant

Posted 17 February 2018 - 04:39 PM

I've been trying to use the directions at sites like these to install ssl certificates so that my virtual machines don't get blocked by all my browsers:
http://ishan.co/ssl-vagrant-local
https://github.com/V...SL-certificates

The problem is that these "instructions" always leave something out, or point to directories/files that don't exist in my box.

Anyone know of a decent set of instructions? I've generated the cert. I just need to find the right file to add it to, and preferably in a way that each of my sites can use it!

Is This A Good Question/Topic? 0
  • +

Replies To: Install self-signed certificates for vagrant

#2 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11423
  • View blog
  • Posts: 19,476
  • Joined: 19-March 11

Re: Install self-signed certificates for vagrant

Posted 18 February 2018 - 12:42 AM

Can you be more specific about the problems you're running into?


Might be useful to see a working example - this is from a project that I used to be involved with. https://github.com/b...ter/Vagrantfile
Was This Post Helpful? 0
  • +
  • -

#3 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3811
  • View blog
  • Posts: 13,850
  • Joined: 08-August 08

Re: Install self-signed certificates for vagrant

Posted 18 February 2018 - 06:12 AM

Specifically, they don't work. This is a huge problem with most tutorials on the web. If you're going to post something with a huge headline that reads: ADDING A SSL CERTIFICATE TO VAGRANT MACHINE FOR LOCAL DEVELOPMENT then your instructions should be accurate down to the smallest detail. Following them should produce a working "Hello World" example. There is no excuse for a line like

Quote

To add SSL certificate and key, edit the file and look for a line that says DocumentRoot and paste following lines below it:
Edit what file? The apache configuration file that doesn't exist in /etc/apache2/sites-enabled because /etc/apache2/ has no sites-enabled directory? I have multiple .conf files in various directories. Which one?

While I'm at it, is it:
SSLEngine on
SSLCertificateFile /vagrant/example.com.cert
SSLCertificateKeyFile /vagrant/example.com.key


or is it:
ssl    on;
ssl_certificate    {vvv_path_to_folder}/ssl/example.com.cert;
ssl_certificate_key    {vvv_path_to_folder}/ssl/example.com.key;


This makes me think that at least one of these two examples is never going to work. Possibly both.

This post has been edited by CTphpnwb: 18 February 2018 - 06:13 AM

Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3811
  • View blog
  • Posts: 13,850
  • Joined: 08-August 08

Re: Install self-signed certificates for vagrant

Posted 19 February 2018 - 07:11 AM

So now I'm seeing on other sites that vagrant and/or Homestead should be fine with ssl by default. What's odd is that this has been working for years, but recently some of my test sites stopped responding and now none respond. I can ping any of them, but can't complete an http request.
MacBook-Pro:Homestead macuser$ curl testing.app
curl: (7) Failed to connect to testing.app port 80: Connection refused
MacBook-Pro:Homestead macuser$ ping testing.app
PING testing.app (192.168.10.10): 56 data bytes
64 bytes from 192.168.10.10: icmp_seq=0 ttl=64 time=0.246 ms
64 bytes from 192.168.10.10: icmp_seq=1 ttl=64 time=0.426 ms
^C
--- testing.app ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.246/0.336/0.426/0.090 ms


Was This Post Helpful? 0
  • +
  • -

#5 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3811
  • View blog
  • Posts: 13,850
  • Joined: 08-August 08

Re: Install self-signed certificates for vagrant

Posted 19 February 2018 - 01:46 PM

I tried doing vagrant up --provision and got this
    default: Running: inline script
    default: Failed to restart php5-fpm.service: Unit php5-fpm.service not found.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.


So then I tried to update the box:
Chriss-MacBook-Pro:Homestead chris$ vagrant box update
==> default: Checking for updates to 'laravel/homestead'
    default: Latest installed version: 2.0.0
    default: Version constraints: 
    default: Provider: virtualbox
There was an error while downloading the metadata for this box.
The error message is shown below:

The requested URL returned error: 404 Not Found



So I'm guessing that there was something wrong with the PHP upgrade (7.1) I attempted months ago.
Was This Post Helpful? 0
  • +
  • -

#6 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11423
  • View blog
  • Posts: 19,476
  • Joined: 19-March 11

Re: Install self-signed certificates for vagrant

Posted 19 February 2018 - 06:54 PM

So can you maybe post the Vagrantfile you're using now? Or ideally a heavily redacted one that exhibits the symptoms you're experiencing?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1