Skip to content

Commit c25cecf

Browse files
authored
[Dotnet-Isolated9.0] Include AGC certs (#1160)
1 parent 68adc86 commit c25cecf

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

host/4/bookworm/dotnet-isolated/dotnet9-isolated/install_ca_certificates.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,33 @@
33
# Source and destination directories
44
source_dir="/var/ssl/root"
55
destination_dir="/usr/local/share/ca-certificates"
6+
need_certificate_update=false
7+
8+
if [[ "$WEBSITES_INCLUDE_CLOUD_CERTS" == "true" ]]; then
9+
echo "WEBSITES_INCLUDE_CLOUD_CERTS is set to true."
10+
agc_source_dir="/usr/local/azure/certs"
11+
if [ "$(ls "$agc_source_dir"/*.crt 2>/dev/null)" ]; then
12+
# Copy CA certificates
13+
cp "$agc_source_dir"/*.crt "$destination_dir"
14+
need_certificate_update=true
15+
fi
16+
else
17+
echo "WEBSITES_INCLUDE_CLOUD_CERTS is not set to true."
18+
fi
19+
620

721
# Check if the source directory has no files with the .crt extension
822
if [ "$(ls "$source_dir"/*.crt 2>/dev/null)" ]; then
923

1024
# Copy CA certificates
1125
cp "$source_dir"/*.crt "$destination_dir"
1226

13-
# Run update-ca-certificates command to update the CA certificate store
14-
update-ca-certificates
27+
need_certificate_update=true
1528

1629
echo "CA certificates copied and updated successfully."
30+
fi
31+
32+
if $need_certificate_update; then
33+
# Run update-ca-certificates command to update the CA certificate store
34+
update-ca-certificates
1735
fi

0 commit comments

Comments
 (0)