Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ fi

# Check if SSL certificates have been imported into Mono's certificate store.
# If certs haven't been installed, some/all of the Nuget packages will fail to restore.
if [ $('certmgr -list -c Trust | grep -c -F "X.509"') -le 1 ]; then
# Note, the result of the certmgr and grep commands returns the number of installed X.509 certificates.
# We need to run the command twice -- on some systems (e.g. macOS) the certs are installed in the user store,
# and on other systems (e.g., Ubuntu) they're installed to the machine store. certmgr only shows what's in
# the selected store, which is why we need to check both.
if [ "$(certmgr -list -c Trust | grep -c -F "X.509")" -le 1 ] && [ "$(certmgr -list -c -m Trust | grep -c -F "X.509")" -le 1 ]; then
echo "No SSL certificates installed so unable to restore NuGet packages." >&2;
echo "Run 'mozroots --sync --import' to install certificates to Mono's certificate store." >&2;
exit 1
Expand Down