@@ -134,7 +134,7 @@ example, are running your own custom ACME server.
134
134
135
135
136
136
## Local CA
137
- During the development phase of a website you might be testing stuff out on a
137
+ During the development phase of a website you might be testing stuff on a
138
138
computer that either does not have a DNS record pointing to itself or perhaps
139
139
it does not have internet access at all. Since certbot has both of these as
140
140
requirements to function properly it was previously impossible to use this
@@ -148,13 +148,18 @@ It also enables us to issue certificates that are valid for `localhost` and/or
148
148
IP addresses like ` ::1 ` , which are otherwise [ impossible] [ 7 ] for certbot to
149
149
create.
150
150
151
+ > You can also use this solution if your intend to deploy behind a CDN and you
152
+ > do not need a "real" certificate in order to encrypt the communication
153
+ > between the origin server and the CDN's infrastructure. But please read
154
+ > this entire section before going forward with that kind of setup.
155
+
151
156
To enable the usage of this local CA you just set
152
157
[ ` USE_LOCAL_CA=1 ` ] ( ../README.md#advanced ) , and this will then trigger the
153
158
execution of the [ ` run_local_ca.sh ` ] ( ../src/scripts/run_local_ca.sh ) script
154
159
instead of the [ ` run_certbot.sh ` ] ( ../src/scripts/run_certbot.sh ) one when it is
155
160
time to renew the certificates. This script, when run, will always overwrite
156
161
any previous keys and certificates, so alternating between the use of a local
157
- CA and certbot without first emptying the ` /etc/letsencrypt ` folder is not
162
+ CA and certbot without first emptying the ` /etc/letsencrypt ` folder is ** not**
158
163
supported.
159
164
160
165
The script is designed to mimic certbot as closely as reasonable, so the
@@ -198,25 +203,25 @@ these files. By then taking the `caCert.pem` and [importing][9] it in your
198
203
browser you will be able to visit these sites without the error stating that
199
204
the certificate is signed by an unknown authority.
200
205
201
- > The validity period for the automatically created CA is only 30 days, and the
202
- reason for this is to deter people from using this solution in production.
203
-
204
206
An important thing to know is that these files are only created if they do
205
207
not exist. What this enables is an even more advanced usecase where you might
206
- already have a private key and certificate that you trust on your devices, so
208
+ already have a private key and certificate that you trust on your devices, and
207
209
you would like to continue using it for the websites you host as well. Read
208
210
more about this in the [ next section] ( #creating-a-custom-ca ) .
209
211
210
212
211
213
### Creating a Custom CA
212
- As was mentioned in the previous section it is possible to supply the
213
- [ ` run_local_ca.sh ` ] ( ../src/scripts/run_local_ca.sh ) script with a local
214
- certificate authority that has been created manually by you, perhaps with a
215
- validity period longer than 30 days and that you want to trust on multiple
216
- other devices. This is a solution that can be used in case you want to set up
217
- HTTPS on services that will never be reachable over the open internet, but you
218
- still want their communication to be secure.
219
-
214
+ The validity period for the automatically created CA is only 30 days by
215
+ default, and the reason for this is to deter people from using this solution
216
+ blindly in production. While it is possible to quickly change this through the
217
+ ` LOCAL_CA_ROOT_CERT_VALIDITY ` variable, there are security concerns regarding
218
+ managing your own certificate authority which should be thought through before
219
+ doing this in a production environment.
220
+
221
+ Nevertheless, as was mentioned in the previous section it is possible to supply
222
+ the [ ` run_local_ca.sh ` ] ( ../src/scripts/run_local_ca.sh ) script with a local
223
+ certificate authority that has been created manually by you that you want to
224
+ trust on multiple other devices.
220
225
Basically all you need to do is to host mount your custom private key and
221
226
certificate to the ` LOCAL_CA_DIR ` , and the script will use these instead of
222
227
the short lived automatically created ones. Just make sure the files are named
@@ -248,6 +253,14 @@ and you may of course take a look at the commands used in the
248
253
[ ` generate_ca() ` ] ( ../src/scripts/run_local_ca.sh ) function to help you on your
249
254
way of creating your own files.
250
255
256
+ When the long term CA is in place you can probably tune the ` RENEWAL_INTERVAL `
257
+ variable to equal something slightly less than the hard-coded ` 90d ` expiry
258
+ time of the leaf certificates created. This is the expiry time recommended by
259
+ Let's Encrypt (and perhaps [ soon mandated] [ 19 ] ), and since the renewal script
260
+ _ should_ always be successful you only need to run it just before the expiry
261
+ time. You can, of course, run it more often than that, but it will not yield
262
+ and special benefits.
263
+
251
264
252
265
253
266
@@ -271,3 +284,4 @@ way of creating your own files.
271
284
[ 16 ] : https://superuser.com/questions/738612/openssl-ca-keyusage-extension/1248085#1248085
272
285
[ 17 ] : https://www.feistyduck.com/library/openssl-cookbook/online/ch-openssl.html
273
286
[ 18 ] : https://nginx.org/en/docs/http/server_names.html
287
+ [ 19 ] : https://www.globalsign.com/en-ae/blog/google-90-day-certificate-validity-requires-automation
0 commit comments