Skip to content

Commit 0b68005

Browse files
committed
fix: do not use cert '-subj' to generate cert, use subjectAltName
Cause: The code was using openssl -subj /CN=$(hostname) to generate the cert used for the server. The argument to '-subj' has a maximum length of 64 characters, but the hostname is longer than that. Consequence: The role would issue an error attempting to generate the certificate if the hostname was too long. Fix: Do not use '-subj'. Certificate verification uses subjectAltName and the role was already using this in the generated cert. Result: The role can generate certificates which are secure without an error when the hostnames are too long for `-subj`. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
1 parent 188996a commit 0b68005

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

tasks/trustee_quadlet.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
# Trustee Server SSL
3939
if [ ! -f {{ __trustee_server_config_dir }}/kbs/server.key ] || [ ! -f {{ __trustee_server_config_dir }}/kbs/server.crt ]; then
4040
openssl req -x509 -newkey rsa:2048 -nodes -keyout {{ __trustee_server_config_dir }}/kbs/server.key \
41-
-subj "/CN=$(hostname -f)/O=Red Hat" \
4241
-addext "basicConstraints=CA:FALSE" \
4342
-addext "keyUsage=digitalSignature,keyEncipherment" \
4443
-addext "extendedKeyUsage=serverAuth" \

0 commit comments

Comments
 (0)