Skip to content

Commit 78453e2

Browse files
Update documentaion on how multi-cert configs are possible
1 parent 5728c20 commit 78453e2

File tree

2 files changed

+52
-3
lines changed

2 files changed

+52
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ instructions, from `@staticfloat`'s image, can be found
2929
Some of the more significant additions to this container:
3030

3131
- Handles multiple server names when [requesting certificates][how-the-script-add-domain-names-to-certificate-requests] (i.e. both `example.com` and `www.example.com`).
32-
- Can request both [RSA and ECDSA][15] keys.
32+
- Can request both [RSA and ECDSA][15] keys ([at the same time][ecdsa-and-rsa-certificates]).
3333
- Will create [Diffie-Hellman parameters][diffie-hellman-parameters] if they are defined.
3434
- Uses the [parent container][9]'s [`/docker-entrypoint.d/`][7] folder.
3535
- Will report correct [exit code][6] when stopped/killed/failed.
@@ -69,7 +69,7 @@ Some of the more significant additions to this container:
6969
- `DHPARAM_SIZE`: The size of the [Diffie-Hellman parameters][diffie-hellman-parameters] (default: `2048`)
7070
- `RSA_KEY_SIZE`: The size of the RSA encryption keys (default: `2048`)
7171
- `ELLIPTIC_CURVE`: The size/[curve][16] of the ECDSA keys (default: `secp256r1`)
72-
- `USE_ECDSA`: Set to `1` to have certbot use ECDSA keys instead of RSA (default: `0`)
72+
- `USE_ECDSA`: Set to `1` to have certbot use [ECDSA keys instead of RSA][ecdsa-and-rsa-certificates] (default: `0`)
7373
- `RENEWAL_INTERVAL`: Time interval between certbot's [renewal checks][renewal-check-interval] (default: `8d`)
7474
- `DEBUG`: Set to `1` to enable debug messages and use the [`nginx-debug`][10] binary (default: `0`)
7575

@@ -167,6 +167,7 @@ as bullet points to what has changed between the releases.
167167
[the-user_conf.d-folder]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#the-user_confd-folder
168168
[changelog]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/changelog.md
169169
[dockerhub_tags]: https://github.com/JonasAlfredsson/docker-nginx-certbot/blob/master/docs/dockerhub_tags.md
170+
[ecdsa-and-rsa-certificates]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#ecdsa-and-rsa-certificates
170171

171172
[1]: https://letsencrypt.org/
172173
[2]: https://github.com/certbot/certbot
@@ -182,5 +183,5 @@ as bullet points to what has changed between the releases.
182183
[12]: https://www.duckdns.org/
183184
[13]: https://portforward.com/router.htm
184185
[14]: https://github.com/JonasAlfredsson/docker-nginx-certbot/issues/28
185-
[15]: https://medium.com/hackernoon/rsa-and-ecdsa-hybrid-nginx-setup-with-letsencrypt-certificates-ee422695d7d3
186+
[15]: https://sectigostore.com/blog/ecdsa-vs-rsa-everything-you-need-to-know/
186187
[16]: https://security.stackexchange.com/a/104991

docs/good_to_know.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,48 @@ above file will then become something like this:
100100
certbot --cert-name "test-name" ... -d yourdomain.org -d www.yourdomain.org -d sub.yourdomain.org
101101
```
102102

103+
## ECDSA and RSA Certificates
104+
[ECDSA (or ECC)][16] certificates use a newer encryption algorithm than the well
105+
established RSA certificates, and are supposedly more secure while being much
106+
smaller. The downside with these is that they are not supported by all clients
107+
yet, but if you don't expect to serve anything outisde the "Modern" row in
108+
[Mozillas compatibility table][17] you should not hesitate to configure certbot
109+
to request these types of certificates.
110+
111+
This is achieved by setting the [environment variable][optional] `USE_ECDSA=1`,
112+
and you can optionally tune which [curve][18] to use with `ELLIPTIC_CURVE`.
113+
If you already have RSA certificates downloaded you will either have to wait
114+
until they expire, or [force](#manualforce-renewal) a renewal, before this
115+
change takes affect.
116+
117+
With this option you will use only one of these types for all of your server
118+
configurations, however, I should mention that there is a way to configure
119+
Nginx to serve both ECDSA and RSA certificates at the same time.
120+
[The setup][21] is a bit more complicated, but the
121+
[`example_server_multicert.conf`](../examples/example_server_multicert.conf)
122+
file should be configured so you should only have to edit the "yourdomain.org"
123+
statements at the top.
124+
125+
How this works is that Nginx is able to [load multiple certificate files][19]
126+
for each server block, and you then configure the cipher suites in an order
127+
that prefers ECDSA certificates. The scripts running inside the container then
128+
looks for some (case insensitive) variant of these strings in the
129+
[`--cert-name`](#how-the-script-add-domain-names-to-certificate-requests)
130+
argument:
131+
132+
- `-rsa`
133+
- `.rsa`
134+
- `-ecc`
135+
- `.ecc`
136+
- `-ecdsa`
137+
- `.ecdsa`
138+
139+
and makes a certificate request with the correct type set. See the
140+
[actual commit][20] for more details, but what you need to know is that
141+
these options override the environment variable. This way you can both use
142+
the most modern encryption, while still supporting semi-old devices.
143+
144+
103145
## Renewal Check Interval
104146
This container will automatically start a certbot certificate renewal check
105147
after the time duration that is defined in the environmental variable
@@ -246,3 +288,9 @@ something I have personally implemented in mine.
246288
[13]: https://github.com/docker-library/docs/tree/master/nginx#using-environment-variables-in-nginx-configuration-new-in-119
247289
[14]: https://certbot.eff.org/docs/using.html#where-are-my-certificates
248290
[15]: https://www.digicert.com/faq/subject-alternative-name.htm
291+
[16]: https://sectigostore.com/blog/ecdsa-vs-rsa-everything-you-need-to-know/
292+
[17]: https://wiki.mozilla.org/Security/Server_Side_TLS
293+
[18]: https://security.stackexchange.com/questions/31772/what-elliptic-curves-are-supported-by-browsers/104991#104991
294+
[19]: https://scotthelme.co.uk/hybrid-rsa-and-ecdsa-certificates-with-nginx/
295+
[20]: https://github.com/JonasAlfredsson/docker-nginx-certbot/commit/9195bf02cb200dcec8206b46da971734b1d6669f
296+
[21]: https://medium.com/hackernoon/rsa-and-ecdsa-hybrid-nginx-setup-with-letsencrypt-certificates-ee422695d7d3

0 commit comments

Comments
 (0)