Skip to content

Commit c6fc9b2

Browse files
authored
Merge pull request #3351 from jimklimov/nit-ssl
Make NUT OpenSSL dialogs more reliable
2 parents 26c9c19 + 94418a6 commit c6fc9b2

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/NIT/nit.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,10 +975,11 @@ EOF
975975
*OpenSSL*)
976976
# OpenSSL CA trust "database" should include hashes
977977
# of CA PEM certificates as symlinks to actual files:
978-
CERTHASH="`openssl x509 -subject_hash -in rootca.pem | head -1`" && [ -n "${CERTHASH}" ] || exit
979-
ln -s rootca.pem "${CERTHASH}".0
980-
ln -s rootca.pem "${CERTHASH}"
981-
ls -l "${TESTCERT_PATH_ROOTCA}"/rootca.pem "${TESTCERT_PATH_ROOTCA}/${CERTHASH}"* || exit
978+
CERTHASH="`openssl x509 -subject_hash -in rootca.pem | head -1`"
979+
# NOTE: Symlinking may be prohibited or not implemented on some platforms (e.g. Windows) or file systems
980+
ln -fs rootca.pem "${CERTHASH}".0 || ln -f rootca.pem "${CERTHASH}".0 || cp -f rootca.pem "${CERTHASH}".0
981+
ln -fs rootca.pem "${CERTHASH}" || ln -f rootca.pem "${CERTHASH}" || cp -f rootca.pem "${CERTHASH}"
982+
ls -l "${TESTCERT_PATH_ROOTCA}"/rootca.pem "${TESTCERT_PATH_ROOTCA}/${CERTHASH}"*
982983
;;
983984
*)
984985
ls -l "${TESTCERT_PATH_ROOTCA}"/rootca.pem || exit

0 commit comments

Comments
 (0)