ca/root
This commit is contained in:
parent
f3c6f7a1cf
commit
6112868374
1 changed files with 17 additions and 20 deletions
|
@ -600,24 +600,6 @@ ${SPCD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")"
|
||||||
SPCD_PYTHON_ALIAS="python3"
|
SPCD_PYTHON_ALIAS="python3"
|
||||||
spcd_split
|
spcd_split
|
||||||
spcd_os_printenv "SPCD_DNS_FILE" "SPCD_PKG_CA" "SPCD_PYTHON_ALIAS"
|
spcd_os_printenv "SPCD_DNS_FILE" "SPCD_PKG_CA" "SPCD_PYTHON_ALIAS"
|
||||||
# set ca command & root
|
|
||||||
case "${SPCD_OS_ID}" in
|
|
||||||
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
|
|
||||||
SPCD_CA_ROOT="/etc/pki/ca-trust/source/anchors"
|
|
||||||
;;
|
|
||||||
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
|
|
||||||
SPCD_CA_ROOT="/usr/local/share/ca-certificates"
|
|
||||||
;;
|
|
||||||
"${SPCD_OS_ARCH}")
|
|
||||||
SPCD_CA_ROOT="/etc/ca-certificates/trust-source/anchors"
|
|
||||||
;;
|
|
||||||
"${SPCD_OS_OPENSUSE}")
|
|
||||||
SPCD_CA_ROOT="/etc/pki/trust/anchors"
|
|
||||||
;;
|
|
||||||
*) ;;
|
|
||||||
esac
|
|
||||||
spcd_split
|
|
||||||
spcd_os_printenv "SPCD_CA_ROOT"
|
|
||||||
# set package manager
|
# set package manager
|
||||||
case "${SPCD_OS_ID}" in
|
case "${SPCD_OS_ID}" in
|
||||||
"${SPCD_OS_ALPINE}")
|
"${SPCD_OS_ALPINE}")
|
||||||
|
@ -1039,12 +1021,27 @@ spcd_ca_install_package() {
|
||||||
|
|
||||||
spcd_ca_write_certificates() {
|
spcd_ca_write_certificates() {
|
||||||
spcd_step "Write certificates"
|
spcd_step "Write certificates"
|
||||||
spcd_os_mkdir "${SPCD_CA_ROOT}"
|
case "${SPCD_OS_ID}" in
|
||||||
|
"${SPCD_OS_ALMA}" | "${SPCD_OS_FEDORA}" | "${SPCD_OS_ROCKY}")
|
||||||
|
spcd_wcc__root="/etc/pki/ca-trust/source/anchors"
|
||||||
|
;;
|
||||||
|
"${SPCD_OS_ALPINE}" | "${SPCD_OS_DEBIAN}" | "${SPCD_OS_UBUNTU}")
|
||||||
|
spcd_wcc__root="/usr/local/share/ca-certificates"
|
||||||
|
;;
|
||||||
|
"${SPCD_OS_ARCH}")
|
||||||
|
spcd_wcc__root="/etc/ca-certificates/trust-source/anchors"
|
||||||
|
;;
|
||||||
|
"${SPCD_OS_OPENSUSE}")
|
||||||
|
spcd_wcc__root="/etc/pki/trust/anchors"
|
||||||
|
;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
spcd_os_mkdir "${spcd_wcc__root}"
|
||||||
while true; do
|
while true; do
|
||||||
spcd_wcc__index=$((spcd_wcc__index + 1))
|
spcd_wcc__index=$((spcd_wcc__index + 1))
|
||||||
eval "spcd_wcc__text=\"\${SPCD_CA_${spcd_wcc__index}}\""
|
eval "spcd_wcc__text=\"\${SPCD_CA_${spcd_wcc__index}}\""
|
||||||
[ -n "${spcd_wcc__text}" ] || break
|
[ -n "${spcd_wcc__text}" ] || break
|
||||||
spcd_wcc__path="${SPCD_CA_ROOT}/${spcd_wcc__index}.crt"
|
spcd_wcc__path="${spcd_wcc__root}/${spcd_wcc__index}.crt"
|
||||||
spcd_split
|
spcd_split
|
||||||
spcd_os_write "${spcd_wcc__path}" "${spcd_wcc__text}"
|
spcd_os_write "${spcd_wcc__path}" "${spcd_wcc__text}"
|
||||||
spcd_openssl_x509 "${spcd_wcc__path}"
|
spcd_openssl_x509 "${spcd_wcc__path}"
|
||||||
|
|
Loading…
Reference in a new issue