Skip to content

Commit

Permalink
tests: include loopback address in alternative names when generating …
Browse files Browse the repository at this point in the history
…certs for localhost

Signed-off-by: Reuben Miller <reuben.d.miller@gmail.com>
  • Loading branch information
reubenmiller committed Jun 19, 2024
1 parent bc7a9bc commit 05ca442
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/common/axum_tls/test_data/_regenerate_certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
days=365000
args=("-days" "$days" "-noenc" \
-subj "/CN=localhost" \
-addext "subjectAltName=DNS:localhost,DNS:*.localhost" \
-addext "subjectAltName=DNS:localhost,DNS:*.localhost,IP:127.0.0.1" \
-addext "basicConstraints=critical,CA:false")

set -eux
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ authorityKeyIdentifier=keyid
basicConstraints=CA:FALSE
keyUsage = digitalSignature, keyAgreement
extendedKeyUsage = serverAuth, clientAuth
subjectAltName=DNS:localhost,IP:$C8Y_PROXY_COMMON_NAME
subjectAltName=DNS:localhost,IP:$C8Y_PROXY_COMMON_NAME,IP:127.0.0.1
EOF

openssl x509 -req \
Expand All @@ -49,7 +49,7 @@ authorityKeyIdentifier=keyid
basicConstraints=CA:FALSE
keyUsage = digitalSignature, keyAgreement
extendedKeyUsage = serverAuth, clientAuth
subjectAltName=DNS:localhost,IP:$FTS_COMMON_NAME
subjectAltName=DNS:localhost,IP:$FTS_COMMON_NAME,IP:127.0.0.1
EOF

openssl genrsa -out main-agent.key 2048
Expand Down
2 changes: 1 addition & 1 deletion tests/RobotFramework/tests/mqtt/gen_certs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cat > v3.ext << EOF
authorityKeyIdentifier=keyid
basicConstraints=CA:FALSE
keyUsage = digitalSignature, keyAgreement
subjectAltName=DNS:$(hostname),DNS:localhost
subjectAltName=DNS:$(hostname),DNS:localhost,IP:127.0.0.1
EOF

openssl x509 -req \
Expand Down
4 changes: 2 additions & 2 deletions tests/images/debian-systemd/files/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ gen_certs() {
authorityKeyIdentifier=keyid
basicConstraints=CA:FALSE
keyUsage = digitalSignature, keyAgreement
subjectAltName=DNS:$(hostname), DNS:localhost
subjectAltName=DNS:$(hostname), DNS:localhost, IP:127.0.0.1
EOF

openssl x509 -req \
Expand Down Expand Up @@ -774,7 +774,7 @@ authorityKeyIdentifier=keyid
basicConstraints=CA:FALSE
keyUsage = digitalSignature, keyAgreement
extendedKeyUsage = serverAuth, clientAuth
subjectAltName=DNS:${CN},DNS:localhost
subjectAltName=DNS:${CN},DNS:localhost,IP:127.0.0.1
EOF
)

Expand Down

0 comments on commit 05ca442

Please sign in to comment.