This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1+ Add a Subject Alternative Name to the certificate generated for Complement tests.
Original file line number Diff line number Diff line change 7373
7474# Generate a TLS key, then generate a certificate by having Complement's CA sign it
7575# Note that both the key and certificate are in PEM format (not DER).
76+
77+ # First generate a configuration file to set up a Subject Alternative Name.
78+ cat > /conf/server.tls.conf << EOF
79+ .include /etc/ssl/openssl.cnf
80+
81+ [SAN]
82+ subjectAltName=DNS:${SERVER_NAME}
83+ EOF
84+
85+ # Generate an RSA key
7686openssl genrsa -out /conf/server.tls.key 2048
7787
78- openssl req -new -key /conf/server.tls.key -out /conf/server.tls.csr \
79- -subj " /CN=${SERVER_NAME} "
88+ # Generate a certificate signing request
89+ openssl req -new -config /conf/server.tls.conf -key /conf/server.tls.key -out /conf/server.tls.csr \
90+ -subj " /CN=${SERVER_NAME} " -reqexts SAN
8091
92+ # Make the Complement Certificate Authority sign and generate a certificate.
8193openssl x509 -req -in /conf/server.tls.csr \
8294 -CA /complement/ca/ca.crt -CAkey /complement/ca/ca.key -set_serial 1 \
83- -out /conf/server.tls.crt
95+ -out /conf/server.tls.crt -extfile /conf/server.tls.conf -extensions SAN
96+
97+ # Assert that we have a Subject Alternative Name in the certificate.
98+ # (grep will exit with 1 here if there isn't a SAN in the certificate.)
99+ openssl x509 -in /conf/server.tls.crt -noout -text | grep DNS:
84100
85101export SYNAPSE_TLS_CERT=/conf/server.tls.crt
86102export SYNAPSE_TLS_KEY=/conf/server.tls.key
You can’t perform that action at this time.
0 commit comments