Fixed ssl
parent
150344868b
commit
8254322264
|
@ -61,9 +61,11 @@ fi
|
|||
# Generate CSR
|
||||
san="subjectAltName = DNS:${hostname}.${username}.${TLD},DNS:*.${hostname}.${username}.${TLD}"
|
||||
[ "${ipstring}" != "" ] && san="${san},${ipstring}"
|
||||
<<<"${san}" grep ' ' && printf "SPACES IN SAN\n" >>"${LOGFILE}"
|
||||
if ! sudo /usr/bin/openssl req -new -sha256 -reqexts SAN \
|
||||
-key "${SSL_CONFIG_DIR}/${username}/${hostname}/server.key" \
|
||||
-out "${SSL_CONFIG_DIR}/${username}/${hostname}.csr" \
|
||||
-config '/etc/ssl/openssl.cnf' \
|
||||
-addext "${san}" \
|
||||
-subj "/O=${SSL_ORG}/OU=${username}/CN=${hostname}.${username}.${TLD}" \
|
||||
>>"${LOGFILE}" 2>&1; then
|
||||
|
|
|
@ -134,7 +134,7 @@ if "${LIB_DIR}/ns_update_add" "${domain}" "${ipv4}" "${ipv6}"
|
|||
fi
|
||||
|
||||
# Create SSL cert
|
||||
if "${LIB_DIR}/ssl_peer_add" "${hostname}" "${username}" "IP:${ipv4},IP:[${ipv6}]"
|
||||
if "${LIB_DIR}/ssl_peer_add" "${hostname}" "${username}" "IP:${ipv4},IP:${ipv6}"
|
||||
then printf 'Successfully signed SSL certs for %s,%s,%s.\n' "${domain}" "${ipv4}" "${ipv6}" >>"${LOGFILE}"
|
||||
else printf 'ERROR! Failed to create certs for %s with IPS: %s %s!\n' "${domain}" "${ipv4}" "${ipv6}" >>"${LOGFILE}"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue