Skip to content

Commit

Permalink
Fix CABundle for flatcar (#92)
Browse files Browse the repository at this point in the history
* Add flatcar support for update-local-ca-certificates.sh

* Update unit tests for update-local-ca-certificates.sh
  • Loading branch information
dergeberl authored Aug 12, 2024
1 parent 7dd27ff commit ca8e007
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,18 @@ if [[ -f "/etc/debian_version" ]]; then
fi
# localcertsdir is supported on Debian based OS only
/usr/sbin/update-ca-certificates --fresh --localcertsdir "/var/lib/ca-certificates-local"
else
/usr/sbin/update-ca-certificates --fresh
exit
fi
if grep -q flatcar "/etc/os-release"; then
# Flatcar needs the file in /etc/ssl/certs/ with .pem file extension
cp "/var/lib/ca-certificates-local/ROOTcerts.crt" /etc/ssl/certs/ROOTcerts.pem
# Flatcar do not support --fresh
/usr/sbin/update-ca-certificates
exit
fi
/usr/sbin/update-ca-certificates --fresh
`)),
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ if [[ -f "/etc/debian_version" ]]; then
fi
# localcertsdir is supported on Debian based OS only
/usr/sbin/update-ca-certificates --fresh --localcertsdir "{{ .pathLocalSSLCerts }}"
else
/usr/sbin/update-ca-certificates --fresh
exit
fi

if grep -q flatcar "/etc/os-release"; then
# Flatcar needs the file in /etc/ssl/certs/ with .pem file extension
cp "{{ .pathLocalSSLCerts }}/ROOTcerts.crt" /etc/ssl/certs/ROOTcerts.pem
# Flatcar do not support --fresh
/usr/sbin/update-ca-certificates
exit
fi

/usr/sbin/update-ca-certificates --fresh

0 comments on commit ca8e007

Please sign in to comment.