···
import ../make-test-python.nix ({ pkgs, ... } : let
4
-
runWithOpenSSL = file: cmd: pkgs.runCommand file {
5
-
buildInputs = [ pkgs.openssl ];
3
+
ca_key = mailerCerts.ca.key;
4
+
ca_pem = mailerCerts.ca.cert;
9
-
ca_key = runWithOpenSSL "ca-key.pem" "openssl genrsa -out $out 2048";
10
-
ca_pem = runWithOpenSSL "ca.pem" ''
12
-
-x509 -new -nodes -key ${ca_key} \
13
-
-days 10000 -out $out -subj "/CN=snakeoil-ca"
15
-
key = runWithOpenSSL "matrix_key.pem" "openssl genrsa -out $out 2048";
16
-
csr = runWithOpenSSL "matrix.csr" ''
19
-
-out $out -subj "/CN=localhost" \
21
-
cert = runWithOpenSSL "matrix_cert.pem" ''
24
-
-CA ${ca_pem} -CAkey ${ca_key} \
25
-
-CAcreateserial -out $out \
6
+
bundle = pkgs.runCommand "bundle" {
7
+
nativeBuildInputs = [ pkgs.minica ];
9
+
minica -ca-cert ${ca_pem} -ca-key ${ca_key} \
11
+
install -Dm444 -t $out localhost/{key,cert}.pem
mailerCerts = import ../common/acme/server/snakeoil-certs.nix;
mailerDomain = mailerCerts.domain;
···
port = config.services.redis.servers.matrix-synapse.port;
85
-
tls_certificate_path = "${cert}";
86
-
tls_private_key_path = "${key}";
69
+
tls_certificate_path = "${bundle}/cert.pem";
70
+
tls_private_key_path = "${bundle}/key.pem";
registration_shared_secret = registrationSharedSecret;
public_baseurl = "https://example.com";
···
database.name = "sqlite3";
206
-
tls_certificate_path = "${cert}";
207
-
tls_private_key_path = "${key}";
190
+
tls_certificate_path = "${bundle}/cert.pem";
191
+
tls_private_key_path = "${bundle}/key.pem";
···
"journalctl -u matrix-synapse.service | grep -q 'Connected to redis'"
serverpostgres.require_unit_state("postgresql.service")
225
-
serverpostgres.succeed("register_new_matrix_user -u ${testUser} -p ${testPassword} -a -k ${registrationSharedSecret} https://localhost:8448/")
209
+
serverpostgres.succeed("REQUESTS_CA_BUNDLE=${ca_pem} register_new_matrix_user -u ${testUser} -p ${testPassword} -a -k ${registrationSharedSecret} https://localhost:8448/")
serverpostgres.succeed("obtain-token-and-register-email")
serversqlite.wait_for_unit("matrix-synapse.service")
serversqlite.wait_until_succeeds(