Skip to content

Commit

Permalink
test: adding correct x509 v3 CA cert
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed May 31, 2024
1 parent 8098fb0 commit 80d03fb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1265,15 +1265,12 @@ emailAddress = olof@hagsand.se
[ req_attributes ]
challengePassword = test
[ x509v3_extensions ]
basicConstraints = critical,CA:true
EOF

# Generate CA cert
# XXX v3 requires x509 version 1
if [ $(openssl version|awk '{print $2}') = "3.3.0" ]; then
openssl req -batch -new -x509v1 -days 1 -config $tmpdir/ca.cnf -keyout $cakey -out $cacert || err1 "Generate CA cert"
else
openssl req -batch -new -x509 -days 1 -config $tmpdir/ca.cnf -keyout $cakey -out $cacert || err1 "Generate CA cert"
fi
openssl req -batch -new -x509 -extensions x509v3_extensions -days 1 -config $tmpdir/ca.cnf -keyout $cakey -out $cacert || err1 "Generate CA cert"
rm -rf $tmpdir
}

Expand Down

0 comments on commit 80d03fb

Please sign in to comment.