SSL Certificates on Remotes

Where to put a remote's own SSL certificate and key when you don't use Let's Encrypt, so Waddle uploads them to the server on every deploy or push.

A project that serves HTTPS needs a certificate in every environment. Locally, Waddle generates one for you. On a remote, it either orders one from Let’s Encrypt (when you enable it), or uses the one you give it. This page covers a scenario where you are not using Let’s Encrypt.

Where the certificate goes

Put the certificate and its private key in your project, one directory per remote:

remotes/production/ssl/cert.crt
remotes/production/ssl/cert.key
remotes/stage/ssl/cert.crt
remotes/stage/ssl/cert.key
remotes/dev/ssl/cert.crt
remotes/dev/ssl/cert.key

Only the remotes you deploy to need one. cert.crt holds the certificate, followed by any intermediate certificates your provider gave you (the “full chain”). cert.key holds the private key, unencrypted.

What Waddle does with it

Every time you deploy or push to a remote, Waddle uploads that remote’s certificate and key into the project’s ssl/ directory on the server, where the project’s webserver reads them. The files are replaced on every push, so renewing a certificate is simple: replace the two files in your project and push again.

If the project serves HTTPS without Let’s Encrypt and the files are missing, the deploy or push stops before changing anything on the server and tells you which files it expected. Without a certificate, the webserver on the remote can’t start.

You don’t need these files when:

Never committed

The whole remotes/ directory is ignored by git. Private keys don’t belong in a repository, and each developer who deploys provides the files on their own machine. They aren’t part of the secrets you export for a colleague either: if a colleague deploys too, give them the certificate separately.