Refactor default_server_san() - Quote all expansions (#494)
Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
parent
757b2776d7
commit
2a9cd44902
@ -1908,10 +1908,10 @@ display_dn() {
|
|||||||
# generate default SAN from req/X509, passed by full pathname
|
# generate default SAN from req/X509, passed by full pathname
|
||||||
default_server_san() {
|
default_server_san() {
|
||||||
path="$1"
|
path="$1"
|
||||||
cn=$(
|
cn="$(
|
||||||
easyrsa_openssl req -in "$path" -noout -subject -nameopt sep_multiline |
|
easyrsa_openssl req -in "$path" -noout -subject -nameopt sep_multiline |
|
||||||
awk -F'=' '/^ *CN=/{print $2}'
|
awk -F'=' '/^ *CN=/{print $2}'
|
||||||
)
|
)"
|
||||||
|
|
||||||
if echo "$cn" | grep -E -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'; then
|
if echo "$cn" | grep -E -q '^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$'; then
|
||||||
print "subjectAltName = IP:$cn"
|
print "subjectAltName = IP:$cn"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user