Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

El Klo's avatar
Level 11

SSL expired

A year ago i started a new laravel project with a homestead box. Now Chrome ( and other browsers ) warn me on pretty much every refresh about a Privacy Error. Chrome is telling me "NET::ERR_CERT_DATE_INVALID" because the certificate expired. I have no idea how to renew a certificate for a Homestead Vagrant box.

Any help?

0 likes
10 replies
El Klo's avatar
Level 11

Thanks. Article is for Mac OS and i'm on Windows 10. Should've mentioned that.

El Klo's avatar
Level 11

Thanks for your help but both articles say nothing about expired SSL, as in my question. I already had SSL up and running for about a year. The certificate is just expired. I would like to know how to renew it.

( Tried the steps in the article for Windows 10 just to be sure but to no avail ).

click's avatar

I've never had to renew a certificate on homestead to be honest. Could it be your homestead machine is not set on the correct time? What does the command date give you in the console?

El Klo's avatar
Level 11

Yeah, me neither. It's doing my head in tbh. No idea where to look/start. Date in the console is just today's date, same as my machine.

wdelfuego's avatar

Just destroy the vagrant box using vagrant destroy and recreate it with vagrant up. The process will automatically create a new SSL certificate that's valid for another year.

This will obviously destroy all data in the virtual machine (including databases and post-provisioning customisations), but if you are doing things correctly you should be able to easily recreate the database(s) by freshly seeding or restoring from backup and post-provisioning customisations should be automated in after dot sh.

I had to write out the dot because this forum thinks I'm posting a link and I'm apparently not allowed to.

lalan's avatar

For anyone else running into this, you can log into Vagrant and move/delete the certificates so they're regenerated on reprovision.

In your Vagrant SSH session, run:

sudo mv /etc/nginx/ssl /etc/nginx/ssl-old-expired

Then reboot your box with the --provision flag (which won't delete your DB or other changes):

vagrant reload --provision

You'll also need to re-trust the newly generated root certificate.

5 likes
pinman's avatar

thanks @lalan , it recreates certificate. But I have another problem: end date of each newly created certificate is the date when it was created. So although it was just created, it is already expired. Does anyone know how to fix this?

cannycookie's avatar

In case anyone needs it, this moves all generated certs and keys. Then exit and run vagrant provision

sudo mkdir -p /etc/ssl/certs-old

# Find certs excluding the CA files and move them
sudo find /etc/ssl/certs -maxdepth 1 -type f -not -name 'ca.*.*' -not -name 'ca-*.*' -exec mv {} /etc/ssl/certs-old \;

Please or to participate in this conversation.