Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 08c8469

Browse files
authored
Remove support for ACME v1 (#10194)
Fixes #9778 ACME v1 has been fully decommissioned for existing installs on June 1st 2021(see https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1/88430/27), so we can now safely remove it from Synapse.
1 parent 8c97d58 commit 08c8469

File tree

18 files changed

+18
-836
lines changed

18 files changed

+18
-836
lines changed

INSTALL.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,7 @@ so, you will need to edit `homeserver.yaml`, as follows:
442442
443443
- You will also need to uncomment the `tls_certificate_path` and
444444
`tls_private_key_path` lines under the `TLS` section. You will need to manage
445-
provisioning of these certificates yourself — Synapse had built-in ACME
446-
support, but the ACMEv1 protocol Synapse implements is deprecated, not
447-
allowed by LetsEncrypt for new sites, and will break for existing sites in
448-
late 2020. See [ACME.md](docs/ACME.md).
445+
provisioning of these certificates yourself.
449446

450447
If you are using your own certificate, be sure to use a `.pem` file that
451448
includes the full certificate chain including any intermediate certificates

README.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,6 @@ the form of::
142142
As when logging in, you will need to specify a "Custom server". Specify your
143143
desired ``localpart`` in the 'User name' box.
144144

145-
ACME setup
146-
==========
147-
148-
For details on having Synapse manage your federation TLS certificates
149-
automatically, please see `<docs/ACME.md>`_.
150-
151-
152145
Security note
153146
=============
154147

changelog.d/10194.removal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove Synapse's support for automatically fetching and renewing certificates using the ACME v1 protocol. This protocol has been fully turned off by Let's Encrypt for existing install on June 1st 2021. Admins previously using this feature should use a [reverse proxy](https://matrix-org.github.io/synapse/develop/reverse_proxy.html) to handle TLS termination, or use an external ACME client (such as [certbot](https://certbot.eff.org/)) to retrieve a certificate and key and provide them to Synapse using the `tls_certificate_path` and `tls_private_key_path` configuration settings.

docker/conf/homeserver.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
tls_certificate_path: "/data/{{ SYNAPSE_SERVER_NAME }}.tls.crt"
88
tls_private_key_path: "/data/{{ SYNAPSE_SERVER_NAME }}.tls.key"
99

10-
{% if SYNAPSE_ACME %}
11-
acme:
12-
enabled: true
13-
port: 8009
14-
{% endif %}
15-
1610
{% endif %}
1711

1812
## Server ##

docs/ACME.md

Lines changed: 0 additions & 161 deletions
This file was deleted.

docs/MSC1711_certificates_FAQ.md

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,6 @@ In this case, your `server_name` points to the host where your Synapse is
101101
running. There is no need to create a `.well-known` URI or an SRV record, but
102102
you will need to give Synapse a valid, signed, certificate.
103103

104-
The easiest way to do that is with Synapse's built-in ACME (Let's Encrypt)
105-
support. Full details are in [ACME.md](./ACME.md) but, in a nutshell:
106-
107-
1. Allow Synapse to listen on port 80 with `authbind`, or forward it from a
108-
reverse proxy.
109-
2. Enable acme support in `homeserver.yaml`.
110-
3. Move your old certificates out of the way.
111-
4. Restart Synapse.
112-
113104
### If you do have an SRV record currently
114105

115106
If you are using an SRV record, your matrix domain (`server_name`) may not
@@ -130,15 +121,9 @@ In this situation, you have three choices for how to proceed:
130121
#### Option 1: give Synapse a certificate for your matrix domain
131122

132123
Synapse 1.0 will expect your server to present a TLS certificate for your
133-
`server_name` (`example.com` in the above example). You can achieve this by
134-
doing one of the following:
135-
136-
* Acquire a certificate for the `server_name` yourself (for example, using
137-
`certbot`), and give it and the key to Synapse via `tls_certificate_path`
138-
and `tls_private_key_path`, or:
139-
140-
* Use Synapse's [ACME support](./ACME.md), and forward port 80 on the
141-
`server_name` domain to your Synapse instance.
124+
`server_name` (`example.com` in the above example). You can achieve this by acquiring a
125+
certificate for the `server_name` yourself (for example, using `certbot`), and giving it
126+
and the key to Synapse via `tls_certificate_path` and `tls_private_key_path`.
142127

143128
#### Option 2: run Synapse behind a reverse proxy
144129

@@ -161,10 +146,9 @@ You can do this with a `.well-known` file as follows:
161146
with Synapse 0.34 and earlier.
162147

163148
2. Give Synapse a certificate corresponding to the target domain
164-
(`customer.example.net` in the above example). You can either use Synapse's
165-
built-in [ACME support](./ACME.md) for this (via the `domain` parameter in
166-
the `acme` section), or acquire a certificate yourself and give it to
167-
Synapse via `tls_certificate_path` and `tls_private_key_path`.
149+
(`customer.example.net` in the above example). You can do this by acquire a
150+
certificate for the target domain and giving it to Synapse via `tls_certificate_path`
151+
and `tls_private_key_path`.
168152

169153
3. Restart Synapse to ensure the new certificate is loaded.
170154

docs/sample_config.yaml

Lines changed: 3 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -552,13 +552,9 @@ retention:
552552
# This certificate, as of Synapse 1.0, will need to be a valid and verifiable
553553
# certificate, signed by a recognised Certificate Authority.
554554
#
555-
# See 'ACME support' below to enable auto-provisioning this certificate via
556-
# Let's Encrypt.
557-
#
558-
# If supplying your own, be sure to use a `.pem` file that includes the
559-
# full certificate chain including any intermediate certificates (for
560-
# instance, if using certbot, use `fullchain.pem` as your certificate,
561-
# not `cert.pem`).
555+
# Be sure to use a `.pem` file that includes the full certificate chain including
556+
# any intermediate certificates (for instance, if using certbot, use
557+
# `fullchain.pem` as your certificate, not `cert.pem`).
562558
#
563559
#tls_certificate_path: "CONFDIR/SERVERNAME.tls.crt"
564560

@@ -609,80 +605,6 @@ retention:
609605
# - myCA2.pem
610606
# - myCA3.pem
611607

612-
# ACME support: This will configure Synapse to request a valid TLS certificate
613-
# for your configured `server_name` via Let's Encrypt.
614-
#
615-
# Note that ACME v1 is now deprecated, and Synapse currently doesn't support
616-
# ACME v2. This means that this feature currently won't work with installs set
617-
# up after November 2019. For more info, and alternative solutions, see
618-
# https://github.com/matrix-org/synapse/blob/master/docs/ACME.md#deprecation-of-acme-v1
619-
#
620-
# Note that provisioning a certificate in this way requires port 80 to be
621-
# routed to Synapse so that it can complete the http-01 ACME challenge.
622-
# By default, if you enable ACME support, Synapse will attempt to listen on
623-
# port 80 for incoming http-01 challenges - however, this will likely fail
624-
# with 'Permission denied' or a similar error.
625-
#
626-
# There are a couple of potential solutions to this:
627-
#
628-
# * If you already have an Apache, Nginx, or similar listening on port 80,
629-
# you can configure Synapse to use an alternate port, and have your web
630-
# server forward the requests. For example, assuming you set 'port: 8009'
631-
# below, on Apache, you would write:
632-
#
633-
# ProxyPass /.well-known/acme-challenge http://localhost:8009/.well-known/acme-challenge
634-
#
635-
# * Alternatively, you can use something like `authbind` to give Synapse
636-
# permission to listen on port 80.
637-
#
638-
acme:
639-
# ACME support is disabled by default. Set this to `true` and uncomment
640-
# tls_certificate_path and tls_private_key_path above to enable it.
641-
#
642-
enabled: false
643-
644-
# Endpoint to use to request certificates. If you only want to test,
645-
# use Let's Encrypt's staging url:
646-
# https://acme-staging.api.letsencrypt.org/directory
647-
#
648-
#url: https://acme-v01.api.letsencrypt.org/directory
649-
650-
# Port number to listen on for the HTTP-01 challenge. Change this if
651-
# you are forwarding connections through Apache/Nginx/etc.
652-
#
653-
port: 80
654-
655-
# Local addresses to listen on for incoming connections.
656-
# Again, you may want to change this if you are forwarding connections
657-
# through Apache/Nginx/etc.
658-
#
659-
bind_addresses: ['::', '0.0.0.0']
660-
661-
# How many days remaining on a certificate before it is renewed.
662-
#
663-
reprovision_threshold: 30
664-
665-
# The domain that the certificate should be for. Normally this
666-
# should be the same as your Matrix domain (i.e., 'server_name'), but,
667-
# by putting a file at 'https://<server_name>/.well-known/matrix/server',
668-
# you can delegate incoming traffic to another server. If you do that,
669-
# you should give the target of the delegation here.
670-
#
671-
# For example: if your 'server_name' is 'example.com', but
672-
# 'https://example.com/.well-known/matrix/server' delegates to
673-
# 'matrix.example.com', you should put 'matrix.example.com' here.
674-
#
675-
# If not set, defaults to your 'server_name'.
676-
#
677-
domain: matrix.example.com
678-
679-
# file to use for the account key. This will be generated if it doesn't
680-
# exist.
681-
#
682-
# If unspecified, we will use CONFDIR/client.key.
683-
#
684-
account_key_file: DATADIR/acme_account.key
685-
686608

687609
## Federation ##
688610

mypy.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,6 @@ ignore_missing_imports = True
176176
[mypy-josepy.*]
177177
ignore_missing_imports = True
178178

179-
[mypy-txacme.*]
180-
ignore_missing_imports = True
181-
182179
[mypy-pympler.*]
183180
ignore_missing_imports = True
184181

synapse/app/_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ async def start(hs: "synapse.server.HomeServer"):
289289
"""
290290
Start a Synapse server or worker.
291291
292-
Should be called once the reactor is running and (if we're using ACME) the
293-
TLS certificates are in place.
292+
Should be called once the reactor is running.
294293
295294
Will start the main HTTP listeners and do some other startup tasks, and then
296295
notify systemd.

0 commit comments

Comments
 (0)