Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
certman
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
certman
Commits
0af54095
Commit
0af54095
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
fix missing key in public_ensure too
parent
2b71b33f
Branches
Branches containing commit
No related tags found
1 merge request
!9
fix missing key in public_ensure too
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cm.sh
+19
-12
19 additions, 12 deletions
cm.sh
with
19 additions
and
12 deletions
cm.sh
+
19
−
12
View file @
0af54095
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
# 2022-03-31 <axel.hahn@iml.unibe.ch> dns authentication with alias domain
# 2022-03-31 <axel.hahn@iml.unibe.ch> dns authentication with alias domain
# 2022-04-04 <axel.hahn@iml.unibe.ch> Bugfix: copy key from csr folder to ~/.acme/
# 2022-04-04 <axel.hahn@iml.unibe.ch> Bugfix: copy key from csr folder to ~/.acme/
# 2022-04-04 <axel.hahn@iml.unibe.ch> added param "list-old"
# 2022-04-04 <axel.hahn@iml.unibe.ch> added param "list-old"
# 2022-04-07 <axel.hahn@iml.unibe.ch> fix missing key in public_ensure before calling public_add too.
# ======================================================================
# ======================================================================
...
@@ -57,6 +58,21 @@ writelog=1
...
@@ -57,6 +58,21 @@ writelog=1
#
#
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# BUGFIX: acme.sh does not create a new key file on renew.
# After switching from csr method to param -d we got a 0 byte Keyfile
function
_fixKeyfile
(){
local
_acme_keyfile
=
~/.acme.sh/
${
CM_fqdn
}
/
${
CM_fqdn
}
.key
if
test
!
-f
"
$_acme_keyfile
"
then
echo
"FIX: copy key from csr folder
$CM_filekey
to
$_acme_keyfile
"
if
!
cp
"
$CM_filekey
"
"
$_acme_keyfile
"
then
exit
1
fi
fi
}
# internal function; list certificates incl. creation date and renew date
# internal function; list certificates incl. creation date and renew date
function
_listCerts
(){
function
_listCerts
(){
$ACME
--list
$ACME
--list
...
@@ -475,6 +491,7 @@ function public_ensure(){
...
@@ -475,6 +491,7 @@ function public_ensure(){
# _wd "--- DNS aliases do NOT match ... deleting cert and create a new one"
# _wd "--- DNS aliases do NOT match ... deleting cert and create a new one"
# public_delete $*
# public_delete $*
_wd
"--- DNS aliases do NOT match ... creating a new one"
_wd
"--- DNS aliases do NOT match ... creating a new one"
_fixKeyfile
public_add
$*
public_add
$*
fi
fi
else
else
...
@@ -550,6 +567,7 @@ function public_list-old(){
...
@@ -550,6 +567,7 @@ function public_list-old(){
exit
$_rc
exit
$_rc
}
}
#
#
# public function - renew a certificate
# public function - renew a certificate
# param string fqdn of domain to renew
# param string fqdn of domain to renew
...
@@ -558,18 +576,7 @@ function public_renew(){
...
@@ -558,18 +576,7 @@ function public_renew(){
_requiresFqdn
_requiresFqdn
_certMustExist
_certMustExist
# BUGFIX: acme.sh does not create a new key file on renew.
_fixKeyfile
# After switching from csr method to pram -d we got a 0 byte Keyfile
local
_acme_keyfile
=
~/.acme.sh/
${
CM_fqdn
}
/
${
CM_fqdn
}
.key
if
test
!
-f
"
$_acme_keyfile
"
then
echo
"FIX: copy key from csr folder
$CM_filekey
to
$_acme_keyfile
"
if
!
cp
"
$CM_filekey
"
"
$_acme_keyfile
"
then
exit
1
fi
fi
# /BUGFIX
$ACME
--renew
-d
${
CM_fqdn
}
$ACME_Params
$ACME
--renew
-d
${
CM_fqdn
}
$ACME_Params
local
_rc
=
$?
local
_rc
=
$?
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment