Skip to content

Commit 9df9a28

Browse files
authored
Update (#13008)
1 parent 4aa83fd commit 9df9a28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

misc/tools.func

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,8 @@ check_for_codeberg_release() {
25192519
# ------------------------------------------------------------------------------
25202520
create_self_signed_cert() {
25212521
local APP_NAME="${1:-${APPLICATION}}"
2522+
local HOSTNAME="$(hostname -f)"
2523+
local IP="$(hostname -I | awk '{print $1}')"
25222524
local APP_NAME_LC=$(echo "${APP_NAME,,}" | tr -d ' ')
25232525
local CERT_DIR="/etc/ssl/${APP_NAME_LC}"
25242526
local CERT_KEY="${CERT_DIR}/${APP_NAME_LC}.key"
@@ -2536,8 +2538,8 @@ create_self_signed_cert() {
25362538

25372539
mkdir -p "$CERT_DIR"
25382540
$STD openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 \
2539-
-subj "/CN=${APP_NAME}" \
2540-
-addext "subjectAltName=DNS:${APP_NAME}" \
2541+
-subj "/CN=${HOSTNAME}" \
2542+
-addext "subjectAltName=DNS:${HOSTNAME},DNS:localhost,IP:${IP},IP:127.0.0.1" \
25412543
-keyout "$CERT_KEY" \
25422544
-out "$CERT_CRT" || {
25432545
msg_error "Failed to create self-signed certificate"

0 commit comments

Comments
 (0)