2

I created a Docker container 3 months ago. I’ve only just come back to it and find its SSL certificate has expired.

I can find nothing on what is best to do.

Is it best to reissue the certificate? If so how?

Or should I junk the container and recreate it?

Or something else?

3

While self-update worked for you, that command is used for updating nitro itself. This may have the side-effect of updating your container, but if nitro is already up-to-date it may not do anything. However, the documentation lists multiple commands that are used to update your containers and environment:

  • nitro update updates containers to their latest version.
  • nitro init initializes or reconfigures the environment, presumably also refreshing the certificates.
  • nitro trust installs the root certificates required for browsers to trust self-provisioned certificates (might be necessary after an update).

Beyond that, docker containers are there specifically to be ephemeral, so destroying and recreating them should never be a problem.

1
3

The easiest way to renew the certificates is nitro restart (specifically on the nitro-proxy container) which is detailed here. Nitro uses Caddy Server as a reverse proxy that runs in its own container and handles generating and terminating local certificates and forwards to the site container to the sites port.

Also the creator of Caddy chimed in on the same issue on how browsers can hold onto certificates longer than needed.

We also have an architecture overview on the documentation site here that have a better overview of how Nitro works.

If you run nitro restart and the certificates have not been renewed, can you try another browser (or private window) and if that still does not work please create an issue so we can work on getting it resolved!

1
  • Thanks Jason, I will refer to this if the problem arises again. Jul 17 '21 at 11:07
1

Someone may have a better answer but what just worked for me was:

nitro self-update

Followed by a Docker reboot.

See the docs on updating.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.