Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
cbb7082a
Commit
cbb7082a
authored
Mar 31, 2023
by
sg1888
Browse files
Fixed bug with wildcard certs and ecc keys
parent
cf3ff4c1
Changes
1
Show whitespace changes
Inline
Side-by-side
deploy/panos.sh
View file @
cbb7082a
...
@@ -61,7 +61,7 @@ deployer() {
...
@@ -61,7 +61,7 @@ deployer() {
content
=
"
$content
${
nl
}
--
$delim
${
nl
}
Content-Disposition: form-data; name=
\"
key
\"\r\n\r\n
$_panos_key
"
content
=
"
$content
${
nl
}
--
$delim
${
nl
}
Content-Disposition: form-data; name=
\"
key
\"\r\n\r\n
$_panos_key
"
content
=
"
$content
${
nl
}
--
$delim
${
nl
}
Content-Disposition: form-data; name=
\"
format
\"\r\n\r\n
pem"
content
=
"
$content
${
nl
}
--
$delim
${
nl
}
Content-Disposition: form-data; name=
\"
format
\"\r\n\r\n
pem"
content
=
"
$content
${
nl
}
--
$delim
${
nl
}
Content-Disposition: form-data; name=
\"
passphrase
\"\r\n\r\n
123456"
content
=
"
$content
${
nl
}
--
$delim
${
nl
}
Content-Disposition: form-data; name=
\"
passphrase
\"\r\n\r\n
123456"
content
=
"
$content
${
nl
}
--
$delim
${
nl
}
Content-Disposition: form-data; name=
\"
file
\"
; filename=
\"
$(
basename
"
$_ckey
"
)
\"
${
nl
}
Content-Type: application/octet-stream
${
nl
}${
nl
}
$(
cat
"
$_ckey
"
)
"
content
=
"
$content
${
nl
}
--
$delim
${
nl
}
Content-Disposition: form-data; name=
\"
file
\"
; filename=
\"
$(
basename
"
$_c
domain
.
key"
)
\"
${
nl
}
Content-Type: application/octet-stream
${
nl
}${
nl
}
$(
cat
"
$_ckey
"
)
"
fi
fi
#Close multipart
#Close multipart
content
=
"
$content
${
nl
}
--
$delim
--
${
nl
}${
nl
}
"
content
=
"
$content
${
nl
}
--
$delim
--
${
nl
}${
nl
}
"
...
@@ -92,9 +92,18 @@ deployer() {
...
@@ -92,9 +92,18 @@ deployer() {
# This is the main function that will call the other functions to deploy everything.
# This is the main function that will call the other functions to deploy everything.
panos_deploy
()
{
panos_deploy
()
{
_cdomain
=
"
$1
"
_cdomain
=
${
1
//[*]/WILDCARD_
}
#Wildcard Safe filename
_ckey
=
"
$2
"
_ckey
=
"
$2
"
_cfullchain
=
"
$5
"
_cfullchain
=
"
$5
"
# VALID ECC KEY CHECK
if
[[
"
${
_ckey
:
-8
}
"
==
"_ecc.key"
]]
&&
[[
!
-f
$_ckey
]]
;
then
_debug
"The ECC key
$_ckey
doesn't exist. Attempting to strip _ecc from the filename"
_ckey
=
"
${
_ckey
:0:
${#
_ckey
}
-8
}
.key"
if
[[
!
-f
$_ckey
]]
;
then
_err
"Still didn't work. Try issuing the certificate using RSA (non-ECC) encryption."
return
1
fi
fi
# PANOS ENV VAR check
# PANOS ENV VAR check
if
[
-z
"
$PANOS_USER
"
]
||
[
-z
"
$PANOS_PASS
"
]
||
[
-z
"
$PANOS_HOST
"
]
;
then
if
[
-z
"
$PANOS_USER
"
]
||
[
-z
"
$PANOS_PASS
"
]
||
[
-z
"
$PANOS_HOST
"
]
;
then
_debug
"No ENV variables found lets check for saved variables"
_debug
"No ENV variables found lets check for saved variables"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment